﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Data;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.esriSystem;
using System.Windows.Forms;
using ESRI.ArcGIS.DataSourcesFile;
//using ESRI.ArcGIS.GlobeCore;
//using ESRI.ArcGIS.Output;
using ESRI.ArcGIS.DataSourcesGDB;
using System.Collections;

namespace CommonLib
{
    public  class ResultCompare
    {
        AccessDB m_dicAccessDB = new AccessDB("Access字典表数据库路径");
        XMLConfig m_readConfig = new XMLConfig("DataCheckTenIndexName.xml");
        XMLConfig m_readDataCheckConfig = new XMLConfig("DataCheck.xml");
        public ResultCompare()
        {
        }

        /// <summary> Shapefile文件-》FeatureLayer图层
        /// </summary>
        /// <param name="shapefileFullName"></param>
        /// <returns></returns>
        public IFeatureLayer getFeatureLayerFromShapefile(string shapefileFullName)
        {
            if (string.IsNullOrEmpty(shapefileFullName))
            {
                return null;
            }
            string pathName = shapefileFullName.Substring(0, shapefileFullName.LastIndexOf("\\"));
            string shapefileName = System.IO.Path.GetFileNameWithoutExtension(shapefileFullName);
            IWorkspaceFactory workspaceFactory = new ShapefileWorkspaceFactoryClass();
            IFeatureWorkspace featureWorkspace = workspaceFactory.OpenFromFile(pathName, 0) as IFeatureWorkspace;
            IFeatureClass featureClass = featureWorkspace.OpenFeatureClass(shapefileName);
            IFeatureLayer featureLayer = new FeatureLayerClass();
            featureLayer.FeatureClass = featureClass;
            return featureLayer;
        }

        /// <summary> Shapefile文件和字段名称-》要素集
        /// </summary>
        /// <param name="shapefileFullName"></param>
        /// <param name="fieldName">字段名</param>
        /// <param name="fieldValue">字段值</param>
        /// <returns></returns>
        public List<IFeature> getFeatureFromShapefileAndFieldName(string shapefileFullName, string fieldName, string fieldValue)
        {
            if (string.IsNullOrEmpty(shapefileFullName) || string.IsNullOrEmpty(fieldName) || string.IsNullOrEmpty(fieldValue))
            {
                return null;
            }
            string pathName = shapefileFullName.Substring(0, shapefileFullName.LastIndexOf("\\"));
            string shapefileName = System.IO.Path.GetFileNameWithoutExtension(shapefileFullName);
            IWorkspaceFactory workspaceFactory = new ShapefileWorkspaceFactoryClass();
            IFeatureWorkspace featureWorkspace = workspaceFactory.OpenFromFile(pathName, 0) as IFeatureWorkspace;
            IFeatureClass featureClass = featureWorkspace.OpenFeatureClass(shapefileName);
            IFeatureLayer featureLayer = new FeatureLayerClass();
            featureLayer.FeatureClass = featureClass;

            IQueryFilter queryFilter = new QueryFilter();
            queryFilter.WhereClause = fieldName + "='" + fieldValue + "'";
            IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(queryFilter, true);
            List<IFeature> featureList = new List<IFeature>();
            IFeature feature = featureCursor.NextFeature();
            while (null != feature)
            {
                featureList.Add(feature);
                feature = featureCursor.NextFeature();
            }
            return featureList;
        }

        /// <summary> Shapefile文件和字段名称-》要素光标
        /// </summary>
        /// <param name="shapefileFullName"></param>
        /// <param name="fieldName">字段名</param>
        /// <param name="fieldValue">字段值</param>
        /// <returns></returns>
        public IFeatureCursor getFeatureFromShapefileAndFieldName(string shapefileFullName, string fieldName, string fieldValue, string s)
        {
            if (string.IsNullOrEmpty(shapefileFullName) || string.IsNullOrEmpty(fieldName) || string.IsNullOrEmpty(fieldValue))
            {
                return null;
            }
            string pathName = shapefileFullName.Substring(0, shapefileFullName.LastIndexOf("\\"));
            string shapefileName = System.IO.Path.GetFileNameWithoutExtension(shapefileFullName);
            IWorkspaceFactory workspaceFactory = new ShapefileWorkspaceFactoryClass();
            IFeatureWorkspace featureWorkspace = workspaceFactory.OpenFromFile(pathName, 0) as IFeatureWorkspace;
            IFeatureClass featureClass = featureWorkspace.OpenFeatureClass(shapefileName);
            IFeatureLayer featureLayer = new FeatureLayerClass();
            featureLayer.FeatureClass = featureClass;
            IQueryFilter queryFilter = new QueryFilter();
            queryFilter.WhereClause = fieldName + "='" + fieldValue + "'";
            IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(queryFilter, true);
            return featureCursor;
        }

        /// <summary> 要素编号字段名、编号字段值和要素指标名—》对应的要素指标值
        /// </summary>
        /// <param name="featureLayer"></param>
        /// <param name="fieldName_BH">编号字段名</param>
        /// <param name="fieldValue_BH">编号字段值</param>
        /// <param name="iranzhiliangfen_ZB">指标名</param>
        /// <returns></returns>
        public double ziranzhiliangfen(IFeatureLayer featureLayer, string fieldName_BH, string fieldValue_BH, string ziranzhiliangfen_ZB)
        {
            if (null == featureLayer || string.IsNullOrEmpty(fieldName_BH) || string.IsNullOrEmpty(fieldValue_BH) || string.IsNullOrEmpty(ziranzhiliangfen_ZB))
            {
                return 0.0;
            }
            double ziranzhiliangfen = 0.0;
            IQueryFilter queryFilter = new QueryFilter();
            queryFilter.WhereClause = fieldName_BH + "='" + fieldValue_BH + "'";
            IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(queryFilter, true);
            List<IFeature> featureList = new List<IFeature>();
            IFeature feature = featureCursor.NextFeature();
            if (null != feature)
            {
                bool isValidValue = double.TryParse(feature.get_Value(feature.Fields.FindField(ziranzhiliangfen_ZB)).ToString(), out ziranzhiliangfen);
                if (isValidValue)
                {
                    return ziranzhiliangfen;
                }
                else
                {
                    return 0.0;
                }
            }
            else
            {
                return 0.0;
            }
        }

        /// <summary> 检查作物自然质量分
        /// </summary>
        /// <param name="featureClass"></param>
        /// <returns></returns>
        public DataTable getDataTableFromCheckZiRanZhiliangfen(IFeatureClass featureClass)
        {
            IQueryFilter queryFilter = new QueryFilter();
            IFeatureCursor featureCursor = featureClass.Search(null, true);
            IFeature feature = featureCursor.NextFeature();
            if (feature == null) return null;

            DataTable dataTable = new DataTable();
            DataColumn column = new DataColumn("县名称");
            dataTable.Columns.Add(column);
            column = new DataColumn("乡镇");
            dataTable.Columns.Add(column);
            column = new DataColumn("县级分等单元编号");
            dataTable.Columns.Add(column);
            column = new DataColumn("作物");
            dataTable.Columns.Add(column);
            column = new DataColumn("自然质量分");
            dataTable.Columns.Add(column);
            column = new DataColumn("检查结果");
            dataTable.Columns.Add(column);
            while (feature != null)
            {
                // 计算基准作物（晚稻）自然质量分：指标权重*指标分值，累加——ziranzhiliangfenArray
                #region 10个指标的权重（查询字典表：分等因素指标体系表）->indexWeightArray[]
                double[] indexWeightArray = new double[10]; // 指标权重
                string indexWeightSql = "select dixing,tianmianpodu,dixiashuiwei,tucenghoudu,zhidi,poumianjiegou,youjizhi,ph,guangai,paishui from zd_fendengyinsuzhibiao where erjiqu='" + "粤中南丘陵地区" + "'";
                DataTable indexWeightDt = m_dicAccessDB.getDataTable(indexWeightSql);
                if (indexWeightDt.Rows.Count > 0)
                {
                    for (int j = 0; j < 10; j++)
                    {
                        indexWeightArray[j] = double.Parse(indexWeightDt.Rows[0].ItemArray[j].ToString().Trim());
                    }
                }
                else
                {
                    return null;
                }
                #endregion

                #region 5种作物的10个指标（质量）分值->zhiliangfenArray[,]
                int[,] zhiliangfenArray = new int[5, 10];
                string[,] zhiliangfenFieldName = new string[5, 10]
                {                                                                                                   
                   {"JZDXFZ",   "JZTMPDFZ",   "JZDXSWFZ",   "JZYXTCHDFZ",   "JZBTZDFZ",   "JZPMGXFZ",   "JZYJZHLFZ",   "JZPHFZ",   "JZGGBZLFZ",   "JZPSTJFZ" },
                   {"ZD1DXFZ",  "ZD1TMPDFZ",  "ZD1DXSWFZ",  "ZD1YXTCHDFZ",  "ZD1BTZDFZ",  "ZD1PMGXFZ",  "ZD1YJZHLFZ",  "ZD1PHFZ",  "ZD1GGBZLFZ",  "ZD1PSTJFZ"},
                   {"ZD2DXFZ",  "ZD2TMPDFZ",  "ZD2DXSWFZ",  "ZD2YXTCHDFZ",  "ZD2BTZDFZ",  "ZD2PMGXFZ",  "ZD2YJZHLFZ",  "ZD2PHFZ",  "ZD2GGBZLFZ",  "ZD2PSTJFZ"},
                   {"ZD3DXFZ",  "ZD3TMPDFZ",  "ZD3DXSWFZ",  "ZD3YXTCHDFZ",  "ZD3BTZDFZ",  "ZD3PMGXFZ",  "ZD3YJZHLFZ",  "ZD3PHFZ",  "ZD3GGBZLFZ",  "ZD3PSTJFZ"},
                   {"ZD4DXFZ",  "ZD4TMPDFZ",  "ZD4DXSWFZ",  "ZD4YXTCHDFZ",  "ZD4BTZDFZ",  "ZD4PMGXFZ",  "ZD4YJZHLFZ",  "ZD4PHFZ",  "ZD4GGBZLFZ",  "ZD4PSTJFZ"},
                };
                for (int i = 0; i < zhiliangfenArray.GetLength(0); i++)//不同作物循环
                {
                    for (int j = 0; j < zhiliangfenArray.GetLength(1); j++)
                    {
                        zhiliangfenArray[i, j] = int.Parse(feature.get_Value(feature.Fields.FindField(zhiliangfenFieldName[i, j])).ToString());
                    }
                }
                #endregion

                #region  自然质量分：10个指标分别相乘后累加->ziranzhiliangfenArray[]
                double[] ziranzhiliangfenArray = new double[5];
                for (int i = 0; i < ziranzhiliangfenArray.Length; i++)
                {
                    for (int j = 0; j < zhiliangfenArray.GetLength(1); j++)
                    {
                        ziranzhiliangfenArray[i] += ((indexWeightArray[j] * zhiliangfenArray[i, j])) / 100;
                    }
                }
                #endregion

                #region  对比计算结果与存在的自然质量分：自然质量分检查
                //自然质量分检查
                string[] zuowuNameFieldName = new string[5] { "JZZWMC", "ZDZW1MC", "ZDZW2MC", "ZDZW3MC", "ZDZW4MC" };
                string[] ziranzhiliangfenFieldName = new string[5] { "JZZZWF", "ZD1JZZWF", "ZD2JZZWF", "ZD3JZZWF", "ZD4JZZWF" };
                for (int i = 0; i < ziranzhiliangfenArray.Length; i++)
                {
                    if (!(Math.Abs((ziranzhiliangfenArray[i] - double.Parse(feature.get_Value(feature.Fields.FindField(ziranzhiliangfenFieldName[i])).ToString()))) < 0.001))
                    {
                        DataRow newRow = dataTable.NewRow();
                        newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                        newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                        newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                        newRow["作物"] = feature.get_Value(feature.Fields.FindField(zuowuNameFieldName[i])).ToString().Trim();
                        newRow["自然质量分"] = feature.get_Value(feature.Fields.FindField(ziranzhiliangfenFieldName[i])).ToString().Trim();
                        newRow["检查结果"] = "自然质量分不正确";
                        dataTable.Rows.Add(newRow);
                    }
                }
                #endregion
                feature = featureCursor.NextFeature();
            }
            return dataTable;
        }

        /// <summary> 检查评价
        /// </summary>
        /// <param name="featureClass"></param>
        /// <returns></returns>
        public DataTable getDataTableFromCheckEvaluation(IFeatureClass featureClass)
        {
            IQueryFilter queryFilter = new QueryFilter();
            IFeatureCursor featureCursor = featureClass.Search(null, true);
            IFeature pFeature = featureCursor.NextFeature();
            if (pFeature == null) return null;

            DataTable dataTable = new DataTable();
            DataColumn column = new DataColumn("县名称");
            dataTable.Columns.Add(column);
            column = new DataColumn("乡镇");
            dataTable.Columns.Add(column);
            column = new DataColumn("县级分等单元编号");
            dataTable.Columns.Add(column);
            column = new DataColumn("参数名称");
            dataTable.Columns.Add(column);
            column = new DataColumn("检查结果");
            dataTable.Columns.Add(column);
            column = new DataColumn("jg");
            dataTable.Columns.Add(column);

            while (pFeature != null)
            {
                #region (1)不同作物的自然质量分和计算、检查综合自然质量分->ziranzhiliangfenArray[]
                double[] ziranzhiliangfenArray = new double[5];
                string[] ziranzhiliangfenFieldName = new string[5] { "JZZZWF", "ZD1JZZWF", "ZD2JZZWF", "ZD3JZZWF", "ZD4JZZWF" };
                double ZHziranzhiliangfen = 0.0;
                for (int i = 0; i < ziranzhiliangfenArray.Length; i++)
                {
                    ziranzhiliangfenArray[i] = double.Parse(pFeature.get_Value(pFeature.Fields.FindField(ziranzhiliangfenFieldName[i])).ToString());
                    ZHziranzhiliangfen += ziranzhiliangfenArray[i];
                }
                if (!(Math.Abs((ZHziranzhiliangfen - double.Parse(pFeature.get_Value(pFeature.Fields.FindField("ZHZLF")).ToString()))) < 1))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["参数名称"] = pFeature.get_Value(pFeature.Fields.FindField("ZHZLF")).ToString().Trim();
                    newRow["检查结果"] = "综合自然质量分不正确";
                    newRow["jg"] = ZHziranzhiliangfen;
                    dataTable.Rows.Add(newRow);
                }
                #endregion


                //在参数检查通过的基础上，该参数已经正确，不用再查，此补去掉
                #region (2)作物的光温|气候生产潜力指数->SCQLZSArray[]
                string[] SCQLZSFieldName = new string[5] { "JZGWZS", "ZDZW1GW", "ZDZW2GW", "ZDZW3QH", "ZDZW4QH" };
                int[] SCQLZSArray = new int[5];
                for (int i = 0; i < SCQLZSFieldName.Length; i++)
                {
                    SCQLZSArray[i] = int.Parse(pFeature.get_Value(pFeature.Fields.FindField(SCQLZSFieldName[i])).ToString());
                }
                // 作物的光温|气候生产潜力指数->GWZSArray、QHZSArray
                //string[] GWZSFieldName = new string[3] { "JZGWZS", "ZDZW1GW", "ZDZW2GW" };
                //string[] QHQLZSFieldName = new string[2] { "ZDZW3QH", "ZDZW4QH" };
                //int[] GWZSArray = new int[3];
                //int[] QHZSArray = new int[2];
                //for (int i = 0; i < GWZSFieldName.Length; i++)
                //{
                //    GWZSArray[i] = int.Parse(pFeature.get_Value(pFeature.Fields.FindField(GWZSFieldName[i])).ToString());
                //}
                //for (int i = 0; i < QHQLZSFieldName.Length; i++)
                //{
                //    QHZSArray[i] = int.Parse(pFeature.get_Value(pFeature.Fields.FindField(QHQLZSFieldName[i])).ToString());
                //}
                #endregion

                //在参数检查通过的基础上，该参数已经正确，不用再查，此补去掉
                #region (3)作物产量比系数—>chanliangbiArray[]
                string[] CLBFieldName = new string[4] { "ZDZW1B", "ZDZW2B", "ZDZW3B", "ZDZW4B" };
                double[] chanliangbiArray = new double[5];
                chanliangbiArray[0] = 1;
                for (int i = 0; i < CLBFieldName.Length; i++)
                {
                    chanliangbiArray[i + 1] = double.Parse(pFeature.get_Value(pFeature.Fields.FindField(CLBFieldName[i])).ToString());
                }
                #endregion

                #region 1、计算、检查各个作物的自然质量等指数、省自然质量等指数:(1)*(2)*(3)累加->provinceZiranzhiliangDengzhishu
                // 计算、检查各个作物的自然质量等指数
                double[] zuowuZiranzhiliangDengzhishuArray = new double[5];//长整型
                for (int i = 0; i < ziranzhiliangfenArray.Length; i++)
                {
                    zuowuZiranzhiliangDengzhishuArray[i] = ziranzhiliangfenArray[i] * SCQLZSArray[i] * chanliangbiArray[i];
                }
                string[] zuowuNameFieldName = new string[5] { "JZZWMC", "ZDZW1MC", "ZDZW2MC", "ZDZW3MC", "ZDZW4MC" };
                string[] ZRDZSFieldName = new string[5] { "JZZRDZS", "ZD1ZRDZS", "ZD2ZRDZS", "ZD3ZRDZS", "ZD4ZRDZS" };
                for (int i = 0; i < ZRDZSFieldName.Length; i++)
                {
                    if (!(Math.Abs((zuowuZiranzhiliangDengzhishuArray[i] - double.Parse(pFeature.get_Value(pFeature.Fields.FindField(ZRDZSFieldName[i])).ToString()))) < 1))
                    {
                        DataRow newRow = dataTable.NewRow();
                        newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                        newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                        newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                        newRow["参数名称"] = pFeature.get_Value(pFeature.Fields.FindField(ZRDZSFieldName[i])).ToString().Trim();//检查什么参数写什么名称：自然质量分
                        newRow["检查结果"] = pFeature.get_Value(pFeature.Fields.FindField(zuowuNameFieldName[i])).ToString().Trim() + "自然质量等指数不正确";
                        newRow["jg"] = zuowuZiranzhiliangDengzhishuArray[i];
                        dataTable.Rows.Add(newRow);
                    }
                }

                // 计算、检查省自然质量等指数
                double provinceZiranzhiliangDengzhishu = 0.0;
                for (int i = 0; i < zuowuZiranzhiliangDengzhishuArray.Length; i++)
                {
                    provinceZiranzhiliangDengzhishu += zuowuZiranzhiliangDengzhishuArray[i];
                }
                if (!(Math.Abs((provinceZiranzhiliangDengzhishu - double.Parse(pFeature.get_Value(pFeature.Fields.FindField("ZRDZS")).ToString()))) < 1))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["参数名称"] = pFeature.get_Value(pFeature.Fields.FindField("ZRDZS")).ToString().Trim();
                    newRow["检查结果"] = "省自然质量等指数不正确";
                    newRow["jg"] = provinceZiranzhiliangDengzhishu;

                    dataTable.Rows.Add(newRow);
                }
                #endregion

                #region 2、计算、检查省级利用等指数、经济等指数
                double liyongXishu = double.Parse(pFeature.get_Value(pFeature.Fields.FindField("TDLYXS")).ToString());
                double jingjiXishu = double.Parse(pFeature.get_Value(pFeature.Fields.FindField("TDJJXS")).ToString());
                double ZRDZS = double.Parse(pFeature.get_Value(pFeature.Fields.FindField("ZRDZS")).ToString());
                double LYDZS = double.Parse(pFeature.get_Value(pFeature.Fields.FindField("LYDZS")).ToString());
                double provinceLiyongDengzhishu = ZRDZS * liyongXishu;
                double provinceJingjiDengzhishu = LYDZS * jingjiXishu;
                if (!(Math.Abs((provinceLiyongDengzhishu - double.Parse(pFeature.get_Value(pFeature.Fields.FindField("LYDZS")).ToString()))) < 1))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["参数名称"] = pFeature.get_Value(pFeature.Fields.FindField("LYDZS")).ToString().Trim();
                    newRow["检查结果"] = "省级利用等指数不正确";
                    newRow["jg"] = provinceLiyongDengzhishu.ToString();

                    dataTable.Rows.Add(newRow);
                }
                if (!(Math.Abs((provinceJingjiDengzhishu - double.Parse(pFeature.get_Value(pFeature.Fields.FindField("DBZ")).ToString()))) < 1))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["参数名称"] = pFeature.get_Value(pFeature.Fields.FindField("DBZ")).ToString().Trim();
                    newRow["检查结果"] = "省级经济等指数不正确";
                    newRow["jg"] = provinceJingjiDengzhishu.ToString();

                    dataTable.Rows.Add(newRow);
                }
                #endregion

                #region 3、计算、检查国家自然质量等指数、利用等指数、经济等指数(以东部区广州省为例）
                double DBZ = double.Parse(pFeature.get_Value(pFeature.Fields.FindField("DBZ")).ToString());
                double countyZiranzhiliangDengzhishu = ZRDZS * 0.7268 + 1236.84;   //国家级自然质量等指数
                double countyLiyongDengzhishu = LYDZS * 0.4438 + 882.58;            //国家级利用等指数
                double countyJingjiDengzhishu = provinceJingjiDengzhishu * 0.4796 + 1146.72;           //国家级经济等指数
                if (!(Math.Abs((countyZiranzhiliangDengzhishu - double.Parse(pFeature.get_Value(pFeature.Fields.FindField("GJZRDZS")).ToString()))) < 1))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["参数名称"] = "GJZRDZS：" + pFeature.get_Value(pFeature.Fields.FindField("GJZRDZS")).ToString().Trim();
                    newRow["检查结果"] = "国家自然质量等指数不正确";
                    newRow["jg"] = countyZiranzhiliangDengzhishu;

                    dataTable.Rows.Add(newRow);
                }
                if (!(Math.Abs((provinceLiyongDengzhishu - double.Parse(pFeature.get_Value(pFeature.Fields.FindField("GJLYDZS")).ToString()))) < 1))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["参数名称"] = "GJLYDZS：" + pFeature.get_Value(pFeature.Fields.FindField("GJLYDZS")).ToString().Trim();
                    newRow["检查结果"] = "国家利用等指数不正确";
                    newRow["jg"] = countyLiyongDengzhishu;

                    dataTable.Rows.Add(newRow);
                }
                if (!(Math.Abs((countyJingjiDengzhishu - double.Parse(pFeature.get_Value(pFeature.Fields.FindField("GJDBZS")).ToString()))) < 1))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["参数名称"] = "GJDBZS：" + pFeature.get_Value(pFeature.Fields.FindField("GJDBZS")).ToString().Trim();
                    newRow["检查结果"] = "国家经济等指数不正确";
                    newRow["jg"] = countyJingjiDengzhishu;

                    dataTable.Rows.Add(newRow);
                }
                #endregion

                #region 4、计算、检查省级自然质量等别、利用等别、经济等别（查询省级等别表）
                int provinceZiranzhiliangDengbie = 0;   //省级自然质量等别
                int provinceLiyongDengbie = 0;          //省级利用等别
                int provinceJingjiDengbie = 0;          //省级经济等别
                string provincezirandengSql = "select zirandengbie from zd_shengjidengbie where zirandeng_min<=" + ZRDZS + " and zirandeng_max>" + provinceZiranzhiliangDengzhishu;
                string provinceliyongdengSql = "select liyongdengbie from zd_shengjidengbie where liyongdeng_min<=" + LYDZS + " and liyongdeng_max>" + provinceLiyongDengzhishu;
                string provincejingjidengSql = "select jingjidengbie from zd_shengjidengbie where jingjideng_min<=" + DBZ + " and jingjideng_max>" + provinceJingjiDengzhishu;
                DataTable provincezirandengDt = m_dicAccessDB.getDataTable(provincezirandengSql);
                DataTable provinceliyongdengDt = m_dicAccessDB.getDataTable(provinceliyongdengSql);
                DataTable provincejingjidengDt = m_dicAccessDB.getDataTable(provincejingjidengSql);
                if (provincezirandengDt.Rows.Count > 0 && provinceliyongdengDt.Rows.Count > 0 && provincejingjidengDt.Rows.Count > 0)
                {
                    provinceZiranzhiliangDengbie = int.Parse(provincezirandengDt.Rows[0].ItemArray[0].ToString());//省级自然质量等别
                    provinceLiyongDengbie = int.Parse(provinceliyongdengDt.Rows[0].ItemArray[0].ToString());      //省级利用等别
                    provinceJingjiDengbie = int.Parse(provincejingjidengDt.Rows[0].ItemArray[0].ToString()); //省级经济等别
                }
                if (!(provinceZiranzhiliangDengbie == int.Parse(pFeature.get_Value(pFeature.Fields.FindField("ZRDB")).ToString())))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["检查结果"] = "省级自然质量等别不正确";
                    dataTable.Rows.Add(newRow);
                }
                if (!(provinceLiyongDengbie == int.Parse(pFeature.get_Value(pFeature.Fields.FindField("LYD")).ToString())))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["检查结果"] = "省级利用等别不正确";
                    dataTable.Rows.Add(newRow);
                }
                if (!(provinceJingjiDengbie == int.Parse(pFeature.get_Value(pFeature.Fields.FindField("DB")).ToString())))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["检查结果"] = "省级经济等别不正确";
                    dataTable.Rows.Add(newRow);
                }
                #endregion

                #region 5、国家自然质量等别、利用等别、经济等别（查询国家等别表）
                int countyZiranzhiliangDengbie = 0;   //国家级自然质量等别
                int countyLiyongDengbie = 0;          //国家级利用等别
                int countyJingjiDengbie = 0;          //国家级经济等别
                double GJZRDZS = double.Parse(pFeature.get_Value(pFeature.Fields.FindField("GJZRDZS")).ToString());
                double GJLYDZS = double.Parse(pFeature.get_Value(pFeature.Fields.FindField("GJLYDZS")).ToString());
                double GJDBZS = double.Parse(pFeature.get_Value(pFeature.Fields.FindField("GJDBZS")).ToString());

                string zirandengSql = "select zirandengbie from zd_guojiadengbie where zirandeng_min<=" + GJZRDZS + " and zirandeng_max>" + countyZiranzhiliangDengzhishu;
                string liyongdengSql = "select liyongdengbie from zd_guojiadengbie where liyongdeng_min<=" + GJLYDZS + " and liyongdeng_max>" + countyLiyongDengzhishu;
                string jingjidengSql = "select jingjidengbie from zd_guojiadengbie where jingjideng_min<=" + GJDBZS + " and jingjideng_max>" + countyJingjiDengzhishu;
                DataTable zirandengDt = m_dicAccessDB.getDataTable(zirandengSql);
                DataTable liyongdengDt = m_dicAccessDB.getDataTable(liyongdengSql);
                DataTable jingjidengDt = m_dicAccessDB.getDataTable(jingjidengSql);
                if (zirandengDt.Rows.Count > 0 && liyongdengDt.Rows.Count > 0 && jingjidengDt.Rows.Count > 0)
                {
                    countyZiranzhiliangDengbie = int.Parse(zirandengDt.Rows[0].ItemArray[0].ToString());//国家级自然质量等别
                    countyLiyongDengbie = int.Parse(liyongdengDt.Rows[0].ItemArray[0].ToString());      //国家级利用等别
                    countyJingjiDengbie = int.Parse(jingjidengDt.Rows[0].ItemArray[0].ToString()); //国家级经济等别
                }
                if (!(countyZiranzhiliangDengbie == int.Parse(pFeature.get_Value(pFeature.Fields.FindField("GJZRDB")).ToString())))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["检查结果"] = "国家级自然质量等别不正确";
                    dataTable.Rows.Add(newRow);
                }
                if (!(countyLiyongDengbie == int.Parse(pFeature.get_Value(pFeature.Fields.FindField("GJLYDB")).ToString())))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["检查结果"] = "国家级利用等别不正确";
                    dataTable.Rows.Add(newRow);
                }
                if (!(countyJingjiDengbie == int.Parse(pFeature.get_Value(pFeature.Fields.FindField("GJDB")).ToString())))
                {
                    DataRow newRow = dataTable.NewRow();
                    newRow["县名称"] = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = pFeature.get_Value(pFeature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = pFeature.get_Value(pFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["检查结果"] = "国家级经济等别不正确";
                    dataTable.Rows.Add(newRow);
                }
                #endregion
                pFeature = featureCursor.NextFeature();
            }
            return dataTable;
        }

        /// <summary> 区县的地类—等别面积汇总
        /// </summary>
        /// <param name="QXName">区县名</param>
        /// <param name="featureLayer">该区县分等图层</param>
        /// <returns>区县的地类—等别面积汇总表</returns>
        public static DataTable GetDL_DBAreaStatisticsDt(String QXName, IFeatureLayer featureLayer)//等别：经济等
        {
            if (featureLayer == null) return null;
            //查询图层等别字段，得到该区县下所有等别
            List<string> dengbieListTemp = new List<string>();
            List<string> dengbieList = new List<string>();
            List<string> dileiListTemp = new List<string>();
            List<string> dileiList = new List<string>();
            #region 查询
            //等到所有等别和所有地类代码
            IQueryFilter queryFilter = new QueryFilter();
            queryFilter.WhereClause = "1=1";
            IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(queryFilter, true);
            IFeature feature = featureCursor.NextFeature();
            while (feature != null)
            {
                dengbieListTemp.Add(feature.get_Value(feature.Fields.FindField("DB")).ToString());
                dileiListTemp.Add(feature.get_Value(feature.Fields.FindField("DLDM")).ToString());
                feature = featureCursor.NextFeature();
            }
            dengbieList = dengbieListTemp.Distinct().ToList();
            dengbieList.Sort();
            dileiList = dileiListTemp.Distinct().ToList();
            dileiList.Sort();
            #endregion
            #region 确定表格结构
            DataTable table = new DataTable();
            DataColumn column = new DataColumn("地类代码");
            table.Columns.Add(column);
            for (int i = 0; i < dengbieList.Count; i++)
            {
                column = new DataColumn(dengbieList[i] + "等地");
                table.Columns.Add(column);
            }
            column = new DataColumn("总计");
            table.Columns.Add(column);
            #endregion
            #region 添加数据
            table.Rows.Clear();
            //查询分等要素图层的Features,获取数据
            for (int i = 0; i < dileiList.Count; i++)
            {
                #region 查询
                queryFilter = new QueryFilter();
                List<double> gradeValueList = new List<double>();
                for (int j = 0; j < dengbieList.Count; j++)
                {
                    const double InvalidMinAvgPtSpc = -1;
                    double sumAvgPtSpc;
                    int featureCount = featureLayer.FeatureClass.FeatureCount(null);

                    if (featureCount == 0)
                    {
                        sumAvgPtSpc = InvalidMinAvgPtSpc;
                    }
                    else
                    {
                        queryFilter = new QueryFilter();
                        queryFilter.WhereClause = "DLDM ='" + dileiList[i].ToString().Trim() + "' and DB = " + int.Parse(dengbieList[j]) + "";
                        featureCursor = featureLayer.FeatureClass.Search(queryFilter, false);
                        ICursor cursor = featureCursor as ICursor;
                        IDataStatistics dataStatistics = new DataStatisticsClass();
                        dataStatistics.Field = "PCTBMJ";
                        dataStatistics.Cursor = cursor;
                        IStatisticsResults statisticsResults = dataStatistics.Statistics;
                        sumAvgPtSpc = statisticsResults.Sum;
                        gradeValueList.Add(Math.Round(sumAvgPtSpc, 2));
                    }
                }
                #endregion
                double Allsum = gradeValueList.Sum();
                DataRow newRow = table.NewRow();
                newRow[0] = dileiList[i];
                for (int k = 0; k < gradeValueList.Count; k++)
                {
                    newRow[k + 1] = gradeValueList[k].ToString();
                }
                newRow[table.Columns.Count - 1] = Allsum;
                table.Rows.Add(newRow);
            }
            List<double> colSumList = new List<double>();
            for (int j = 0; j < dengbieList.Count + 1; j++)
            {
                double colSum = 0.0;
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    colSum += double.Parse(table.Rows[i][j + 1].ToString());
                }
                colSumList.Add(colSum);
            }
            DataRow newRowSum = table.NewRow();
            newRowSum[0] = "合计";
            for (int k = 0; k < colSumList.Count; k++)
            {
                newRowSum[k + 1] = colSumList[k].ToString();
            }
            table.Rows.Add(newRowSum);
            #endregion
            return table;
        }

        /// <summary>区县的地类-自然等别面积汇总
        /// </summary>
        /// <param name="QXName">区县名</param>
        /// <param name="featureLayer">该区县的分等单元图层</param>
        /// <returns>区县的地类-自然等别汇总表</returns>
        public static DataTable GetDL_ZRDBAreaStatisticsDt(String QXName, IFeatureLayer featureLayer)//自然等别
        {
            if (featureLayer == null) return null;
            //查询图层等别字段，得到该区县下所有等别
            List<string> dengbieListTemp = new List<string>();
            List<string> dengbieList = new List<string>();
            List<string> dileiListTemp = new List<string>();
            List<string> dileiList = new List<string>();
            #region 查询
            //等到所有等别和所有地类代码
            IQueryFilter queryFilter = new QueryFilter();
            //queryFilter.WhereClause = ("X='" + QXName + "'");
            //IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(queryFilter, true);
            IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(null, true);
            IFeature feature = featureCursor.NextFeature();
            while (feature != null)
            {
                dengbieListTemp.Add(feature.get_Value(feature.Fields.FindField("ZRDB")).ToString());
                dileiListTemp.Add(feature.get_Value(feature.Fields.FindField("DLDM")).ToString());
                feature = featureCursor.NextFeature();
            }
            dengbieList = dengbieListTemp.Distinct().ToList();
            dengbieList.Sort();
            dileiList = dileiListTemp.Distinct().ToList();
            dileiList.Sort();
            #endregion
            #region 确定表格结构
            DataTable table = new DataTable();
            DataColumn column = new DataColumn("地类代码");
            table.Columns.Add(column);
            for (int i = 0; i < dengbieList.Count; i++)
            {
                column = new DataColumn(dengbieList[i] + "等地");
                table.Columns.Add(column);
            }
            column = new DataColumn("总计");
            table.Columns.Add(column);
            #endregion
            #region 添加数据
            table.Rows.Clear();
            //查询分等要素图层的Features,获取数据
            for (int i = 0; i < dileiList.Count; i++)
            {
                #region 查询
                queryFilter = new QueryFilter();
                List<double> gradeValueList = new List<double>();
                for (int j = 0; j < dengbieList.Count; j++)
                {
                    const double InvalidMinAvgPtSpc = -1;
                    double sumAvgPtSpc;
                    int featureCount = featureLayer.FeatureClass.FeatureCount(null);

                    if (featureCount == 0)
                    {
                        sumAvgPtSpc = InvalidMinAvgPtSpc;
                    }
                    else
                    {
                        queryFilter = new QueryFilter();
                        queryFilter.WhereClause = "DLDM ='" + dileiList[i].ToString().Trim() + "' and ZRDB = " + int.Parse(dengbieList[j]) + "";
                        featureCursor = featureLayer.FeatureClass.Search(queryFilter, false);
                        ICursor cursor = featureCursor as ICursor;
                        IDataStatistics dataStatistics = new DataStatisticsClass();
                        dataStatistics.Field = "PCTBMJ";
                        dataStatistics.Cursor = cursor;
                        IStatisticsResults statisticsResults = dataStatistics.Statistics;
                        sumAvgPtSpc = statisticsResults.Sum;
                        gradeValueList.Add(Math.Round(sumAvgPtSpc, 2));
                    }
                }
                #endregion
                double Allsum = gradeValueList.Sum();
                DataRow newRow = table.NewRow();
                newRow[0] = dileiList[i];
                for (int k = 0; k < gradeValueList.Count; k++)
                {
                    newRow[k + 1] = gradeValueList[k].ToString();
                }
                newRow[table.Columns.Count - 1] = Allsum;
                table.Rows.Add(newRow);
            }
            List<double> colSumList = new List<double>();
            for (int j = 0; j < dengbieList.Count + 1; j++)
            {
                double colSum = 0.0;
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    colSum += double.Parse(table.Rows[i][j + 1].ToString());
                }
                colSumList.Add(colSum);
            }
            DataRow newRowSum = table.NewRow();
            newRowSum[0] = "合计";
            for (int k = 0; k < colSumList.Count; k++)
            {
                newRowSum[k + 1] = colSumList[k].ToString();
            }
            table.Rows.Add(newRowSum);
            #endregion
            return table;
        }

        /// <summary>区县的地类-利用等面积汇总
        /// </summary>
        /// <param name="QXName">区县名</param>
        /// <param name="featureLayer">该区县的分等单元图层</param>
        /// <returns>区县的地类-利用等别汇总表</returns>
        public static DataTable GetDL_LYDAreaStatisticsDt(String QXName, IFeatureLayer featureLayer)//利用等别
        {
            if (featureLayer == null) return null;
            //查询图层等别字段，得到该区县下所有等别
            List<string> dengbieListTemp = new List<string>();
            List<string> dengbieList = new List<string>();
            List<string> dileiListTemp = new List<string>();
            List<string> dileiList = new List<string>();
            #region 查询
            //等到所有等别和所有地类代码
            IQueryFilter queryFilter = new QueryFilter();
            //queryFilter.WhereClause = ("X='" + QXName + "'");
            //IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(queryFilter, true);
            IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(null, true);
            IFeature feature = featureCursor.NextFeature();
            while (feature != null)
            {
                dengbieListTemp.Add(feature.get_Value(feature.Fields.FindField("LYD")).ToString());
                dileiListTemp.Add(feature.get_Value(feature.Fields.FindField("DLDM")).ToString());
                feature = featureCursor.NextFeature();
            }
            dengbieList = dengbieListTemp.Distinct().ToList();
            dengbieList.Sort();
            dileiList = dileiListTemp.Distinct().ToList();
            dileiList.Sort();
            #endregion
            #region 确定表格结构
            DataTable table = new DataTable();
            DataColumn column = new DataColumn("地类代码");
            table.Columns.Add(column);
            for (int i = 0; i < dengbieList.Count; i++)
            {
                column = new DataColumn(dengbieList[i] + "等地");
                table.Columns.Add(column);
            }
            column = new DataColumn("总计");
            table.Columns.Add(column);
            #endregion
            #region 添加数据
            table.Rows.Clear();
            //查询分等要素图层的Features,获取数据
            for (int i = 0; i < dileiList.Count; i++)
            {
                #region 查询
                queryFilter = new QueryFilter();
                List<double> gradeValueList = new List<double>();
                for (int j = 0; j < dengbieList.Count; j++)
                {
                    const double InvalidMinAvgPtSpc = -1;
                    double sumAvgPtSpc;
                    int featureCount = featureLayer.FeatureClass.FeatureCount(null);

                    if (featureCount == 0)
                    {
                        sumAvgPtSpc = InvalidMinAvgPtSpc;
                    }
                    else
                    {
                        queryFilter = new QueryFilter();
                        queryFilter.WhereClause = "DLDM ='" + dileiList[i].ToString().Trim() + "' and LYD = " + int.Parse(dengbieList[j]) + "";
                        featureCursor = featureLayer.FeatureClass.Search(queryFilter, false);
                        ICursor cursor = featureCursor as ICursor;
                        IDataStatistics dataStatistics = new DataStatisticsClass();
                        dataStatistics.Field = "PCTBMJ";
                        dataStatistics.Cursor = cursor;
                        IStatisticsResults statisticsResults = dataStatistics.Statistics;
                        sumAvgPtSpc = statisticsResults.Sum;
                        gradeValueList.Add(Math.Round(sumAvgPtSpc, 2));
                    }
                }
                #endregion
                double Allsum = gradeValueList.Sum();
                DataRow newRow = table.NewRow();
                newRow[0] = dileiList[i];
                for (int k = 0; k < gradeValueList.Count; k++)
                {
                    newRow[k + 1] = gradeValueList[k].ToString();
                }
                newRow[table.Columns.Count - 1] = Allsum;
                table.Rows.Add(newRow);
            }
            List<double> colSumList = new List<double>();
            for (int j = 0; j < dengbieList.Count + 1; j++)
            {
                double colSum = 0.0;
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    colSum += double.Parse(table.Rows[i][j + 1].ToString());
                }
                colSumList.Add(colSum);
            }
            DataRow newRowSum = table.NewRow();
            newRowSum[0] = "合计";
            for (int k = 0; k < colSumList.Count; k++)
            {
                newRowSum[k + 1] = colSumList[k].ToString();
            }
            table.Rows.Add(newRowSum);
            #endregion
            return table;
        }

        /// <summary>区县的地类-等级面积汇总
        /// </summary>
        /// <param name="QXName">区县名</param>
        /// <param name="featureLayer">该区县的分等单元图层</param>
        /// <param name="statisticFieldName">该区县的分等单元图层的等级字段名（等别（DB），自然等别（ZRDB），利用等（LYD）</param>
        /// <returns>对应区县的地类-等级的面积汇总表</returns>
        public static DataTable GetDL_AreaStatisticsDt(String QXName, IFeatureLayer featureLayer, string statisticFieldName)//各种等别
        {
            if (featureLayer == null) return null;
            //查询图层等别字段，得到该区县下所有等别
            List<string> dengbieListTemp = new List<string>();
            List<string> dengbieList = new List<string>();
            List<string> dileiListTemp = new List<string>();
            List<string> dileiList = new List<string>();
            #region 查询
            //等到所有等别和所有地类代码
            IQueryFilter queryFilter = new QueryFilter();
            //queryFilter.WhereClause = ("X='" + QXName + "'");
            //IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(queryFilter, true);
            IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(null, true);
            IFeature feature = featureCursor.NextFeature();
            while (feature != null)
            {
                dengbieListTemp.Add(feature.get_Value(feature.Fields.FindField(statisticFieldName)).ToString());
                dileiListTemp.Add(feature.get_Value(feature.Fields.FindField("DLDM")).ToString());
                feature = featureCursor.NextFeature();
            }
            dengbieList = dengbieListTemp.Distinct().ToList();
            dengbieList.Sort();
            dileiList = dileiListTemp.Distinct().ToList();
            dileiList.Sort();
            #endregion
            #region 确定表格结构
            DataTable table = new DataTable();
            DataColumn column = new DataColumn("地类代码");
            table.Columns.Add(column);
            for (int i = 0; i < dengbieList.Count; i++)
            {
                column = new DataColumn(dengbieList[i] + "等地");
                table.Columns.Add(column);
            }
            column = new DataColumn("总计");
            table.Columns.Add(column);
            #endregion
            #region 添加数据
            table.Rows.Clear();
            //查询分等要素图层的Features,获取数据
            for (int i = 0; i < dileiList.Count; i++)
            {
                #region 查询
                queryFilter = new QueryFilter();
                List<double> gradeValueList = new List<double>();
                for (int j = 0; j < dengbieList.Count; j++)
                {
                    const double InvalidMinAvgPtSpc = -1;
                    double sumAvgPtSpc;
                    int featureCount = featureLayer.FeatureClass.FeatureCount(null);

                    if (featureCount == 0)
                    {
                        sumAvgPtSpc = InvalidMinAvgPtSpc;
                    }
                    else
                    {
                        queryFilter = new QueryFilter();
                        queryFilter.WhereClause = "DLDM ='" + dileiList[i].ToString().Trim() + "' and " + statisticFieldName + "=" + int.Parse(dengbieList[j]);
                        featureCursor = featureLayer.FeatureClass.Search(queryFilter, false);
                        ICursor cursor = featureCursor as ICursor;
                        IDataStatistics dataStatistics = new DataStatisticsClass();
                        dataStatistics.Field = "PCTBMJ";
                        dataStatistics.Cursor = cursor;
                        IStatisticsResults statisticsResults = dataStatistics.Statistics;
                        sumAvgPtSpc = statisticsResults.Sum;
                        gradeValueList.Add(Math.Round(sumAvgPtSpc, 2));
                    }
                }
                #endregion
                double Allsum = gradeValueList.Sum();
                DataRow newRow = table.NewRow();
                newRow[0] = dileiList[i];
                for (int k = 0; k < gradeValueList.Count; k++)
                {
                    newRow[k + 1] = gradeValueList[k].ToString();
                }
                newRow[table.Columns.Count - 1] = Allsum;
                table.Rows.Add(newRow);
            }
            List<double> colSumList = new List<double>();
            for (int j = 0; j < dengbieList.Count + 1; j++)
            {
                double colSum = 0.0;
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    colSum += double.Parse(table.Rows[i][j + 1].ToString());
                }
                colSumList.Add(colSum);
            }
            DataRow newRowSum = table.NewRow();
            newRowSum[0] = "合计";
            for (int k = 0; k < colSumList.Count; k++)
            {
                newRowSum[k + 1] = colSumList[k].ToString();
            }
            table.Rows.Add(newRowSum);
            #endregion
            return table;
        }

        /// <summary>乡镇耕地质量等级结果-面积汇总表
        /// </summary>
        /// <param name="QXName">区县名</param>
        /// <param name="featureLayer">该区县的图层名</param>
        /// <param name="statisticFieldName">该区县的分等单元图层的等级字段名（等别（DB），自然等别（ZRDB），利用等（LYD）</param>
        /// <returns></returns>
        public static DataTable GetXZ_Result_AreaStatisticsDt(String QXName, IFeatureLayer featureLayer, string statisticFieldName)
        {
            if (featureLayer == null) return null;
            //查询图层等别字段，得到该区县下所有等别
            List<string> dengbieListTemp = new List<string>();
            List<string> dengbieList = new List<string>();
            List<string> xzdmListTemp = new List<string>();
            List<string> xzdmList = new List<string>();
            #region 查询
            //等到所有等别和所有地类代码
            IQueryFilter queryFilter = new QueryFilter();
            //queryFilter.WhereClause = ("X='" + QXName + "'");
            //IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(queryFilter, true);
            IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(null, true);
            IFeature feature = featureCursor.NextFeature();
            while (feature != null)
            {
                dengbieListTemp.Add(feature.get_Value(feature.Fields.FindField(statisticFieldName)).ToString());
                xzdmListTemp.Add(feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString());
                feature = featureCursor.NextFeature();
            }
            dengbieList = dengbieListTemp.Distinct().ToList();
            dengbieList.Sort();
            xzdmList = xzdmListTemp.Distinct().ToList();
            xzdmList.Sort();
            #endregion
            #region 确定表格结构
            DataTable table = new DataTable();
            DataColumn column = new DataColumn("行政代码");
            table.Columns.Add(column);
            column = new DataColumn("村");
            table.Columns.Add(column);
            for (int i = 0; i < dengbieList.Count; i++)
            {
                column = new DataColumn(dengbieList[i] + "等地");
                table.Columns.Add(column);
            }
            column = new DataColumn("总计");
            table.Columns.Add(column);
            #endregion
            #region 添加数据
            table.Rows.Clear();
            //查询分等要素图层的Features,获取数据
            for (int i = 0; i < xzdmList.Count; i++)
            {
                #region 查询
                queryFilter = new QueryFilter();
                queryFilter.WhereClause = ("XJDYBH ='" + xzdmList[i].ToString().Trim() + "'");
                featureCursor = featureLayer.FeatureClass.Search(queryFilter, true);
                IFeature pfeature = featureCursor.NextFeature();

                string xjbydh = pfeature.get_Value(pfeature.Fields.FindField("XZC")).ToString();

                List<double> gradeValueList = new List<double>();
                double sum;
                for (int j = 0; j < dengbieList.Count; j++)
                {
                    sum = 0.0;
                    while (pfeature != null)
                    {
                        if (pfeature.get_Value(pfeature.Fields.FindField(statisticFieldName)).ToString().Equals(dengbieList[j].ToString().Trim()))//等别
                        {
                            sum += double.Parse(pfeature.get_Value(pfeature.Fields.FindField("PCTBMJ")).ToString());
                        }
                        pfeature = featureCursor.NextFeature();
                    }
                    IFeatureSelection pFeatureSelection = featureLayer as IFeatureSelection;
                    pFeatureSelection.SelectFeatures(queryFilter, esriSelectionResultEnum.esriSelectionResultNew, false);
                    ISelectionSet pSelectionSet;
                    pSelectionSet = pFeatureSelection.SelectionSet;
                    ICursor pCursor;
                    pSelectionSet.Search(queryFilter, true, out pCursor);
                    featureCursor = pCursor as IFeatureCursor;
                    pfeature = featureCursor.NextFeature();
                    gradeValueList.Add(Math.Round(sum, 2));
                }
                #endregion
                double Allsum = gradeValueList.Sum();
                DataRow newRow = table.NewRow();
                newRow[0] = xjbydh;
                newRow[1] = xzdmList[i];
                for (int k = 0; k < gradeValueList.Count; k++)
                {
                    newRow[k + 2] = gradeValueList[k].ToString();
                }
                newRow[table.Columns.Count - 1] = Allsum;
                table.Rows.Add(newRow);
            }
            List<double> colSumList = new List<double>();
            for (int j = 0; j < dengbieList.Count + 1; j++)
            {
                double colSum = 0.0;
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    colSum += double.Parse(table.Rows[i][j + 2].ToString());
                }
                colSumList.Add(colSum);
            }
            DataRow newRowSum = table.NewRow();
            newRowSum[1] = "合计";
            for (int k = 0; k < colSumList.Count; k++)
            {
                newRowSum[k + 2] = colSumList[k].ToString();
            }
            table.Rows.Add(newRowSum);
            #endregion
            return table;
        }

        /// <summary>区县耕地质量等级结果-面积汇总表
        /// </summary>
        /// <param name="QXName">区县名</param>
        /// <param name="featureLayer">该区县的图层名</param>
        /// <param name="statisticFieldName">该区县的分等单元图层的等级字段名（等别（DB），自然等别（ZRDB），利用等（LYD）</param>
        /// <returns></returns>
        public static DataTable GetQX_Result_AreaStatisticsDt(String QXName, IFeatureLayer featureLayer, string statisticFieldName)
        {
            if (featureLayer == null) return null;
            //查询图层等别字段，得到该区县下所有等别
            List<string> dengbieListTemp = new List<string>();
            List<string> dengbieList = new List<string>();
            List<string> xzNameListTemp = new List<string>();
            List<string> xzNameList = new List<string>();
            #region 查询
            //等到所有等别和所有地类代码
            IQueryFilter queryFilter = new QueryFilter();
            //queryFilter.WhereClause = ("X='" + QXName + "'");
            //IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(queryFilter, true);
            IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(null, true);
            IFeature feature = featureCursor.NextFeature();
            while (feature != null)
            {
                dengbieListTemp.Add(feature.get_Value(feature.Fields.FindField(statisticFieldName)).ToString());
                xzNameListTemp.Add(feature.get_Value(feature.Fields.FindField("XZ")).ToString());
                feature = featureCursor.NextFeature();
            }
            dengbieList = dengbieListTemp.Distinct().ToList();
            dengbieList.Sort();
            xzNameList = xzNameListTemp.Distinct().ToList();
            xzNameList.Sort();
            #endregion
            #region 确定表格结构
            DataTable table = new DataTable();
            DataColumn column = new DataColumn("行政代码");
            table.Columns.Add(column);
            column = new DataColumn("乡镇");
            table.Columns.Add(column);
            for (int i = 0; i < dengbieList.Count; i++)
            {
                column = new DataColumn(dengbieList[i] + "等地");
                table.Columns.Add(column);
            }
            column = new DataColumn("总计");
            table.Columns.Add(column);
            #endregion
            #region 添加数据
            table.Rows.Clear();
            //查询分等要素图层的Features,获取数据
            for (int i = 0; i < xzNameList.Count; i++)
            {
                #region 查询
                queryFilter = new QueryFilter();
                queryFilter.WhereClause = ("XZ ='" + xzNameList[i].ToString().Trim() + "'");
                featureCursor = featureLayer.FeatureClass.Search(queryFilter, true);
                IFeature pfeature = featureCursor.NextFeature();

                string xjbydh = pfeature.get_Value(pfeature.Fields.FindField("XJDYBH")).ToString().Substring(0, 9);

                List<double> gradeValueList = new List<double>();
                double sum;
                for (int j = 0; j < dengbieList.Count; j++)
                {
                    sum = 0.0;
                    while (pfeature != null)
                    {
                        if (pfeature.get_Value(pfeature.Fields.FindField(statisticFieldName)).ToString().Equals(dengbieList[j].ToString().Trim()))//等别
                        {
                            sum += double.Parse(pfeature.get_Value(pfeature.Fields.FindField("PCTBMJ")).ToString());
                        }
                        pfeature = featureCursor.NextFeature();
                    }
                    IFeatureSelection pFeatureSelection = featureLayer as IFeatureSelection;
                    pFeatureSelection.SelectFeatures(queryFilter, esriSelectionResultEnum.esriSelectionResultNew, false);
                    ISelectionSet pSelectionSet;
                    pSelectionSet = pFeatureSelection.SelectionSet;
                    ICursor pCursor;
                    pSelectionSet.Search(queryFilter, true, out pCursor);
                    featureCursor = pCursor as IFeatureCursor;
                    pfeature = featureCursor.NextFeature();
                    gradeValueList.Add(Math.Round(sum, 2));
                }
                #endregion
                double Allsum = gradeValueList.Sum();
                DataRow newRow = table.NewRow();
                newRow[0] = xjbydh;
                newRow[1] = xzNameList[i];
                for (int k = 0; k < gradeValueList.Count; k++)
                {
                    newRow[k + 2] = gradeValueList[k].ToString();
                }
                newRow[table.Columns.Count - 1] = Allsum;
                table.Rows.Add(newRow);
            }
            List<double> colSumList = new List<double>();
            for (int j = 0; j < dengbieList.Count + 1; j++)
            {
                double colSum = 0.0;
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    colSum += double.Parse(table.Rows[i][j + 2].ToString());
                }
                colSumList.Add(colSum);
            }
            DataRow newRowSum = table.NewRow();
            newRowSum[0] = QXName;
            newRowSum[1] = "合计";
            for (int k = 0; k < colSumList.Count; k++)
            {
                newRowSum[k + 2] = colSumList[k].ToString();
            }
            table.Rows.Add(newRowSum);
            #endregion
            return table;
        }

        /// <summary>返回区县内所有乡镇名称
        /// 
        /// </summary>
        /// <param name="QXName">区县名</param>
        /// <param name="featureLayer">该区县的图层名</param>
        /// <param name="statisticFieldName">该区县的分等单元图层的等级字段名（等别（DB），自然等别（ZRDB），利用等（LYD）</param>
        /// <returns></returns>
        public static List<string> Get_xzNameList(String QXName, IFeatureLayer featureLayer, string statisticFieldName)
        {
            if (featureLayer == null) return null;
            List<string> xzNameListTemp = new List<string>();
            List<string> xzNameList = new List<string>();
            #region 查询
            IQueryFilter queryFilter = new QueryFilter();
            IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(null, true);
            IFeature feature = featureCursor.NextFeature();
            while (feature != null)
            {
                xzNameListTemp.Add(feature.get_Value(feature.Fields.FindField("XZ")).ToString());
                feature = featureCursor.NextFeature();
            }
            xzNameList = xzNameListTemp.Distinct().ToList();
            xzNameList.Sort();
            #endregion
            return xzNameList;
        }
        /// <summary>读取mdb数据库中FeatureClass
        /// </summary>
        /// <param name="m_workspacePath"></param>
        /// <param name="m_featureLayerName"></param>
        /// <returns></returns>
        public IFeatureClass GetMdbFeatrueClass(string m_workspacePath, string m_featureLayerName)
        {
            IWorkspaceFactory workspaceFactory = new AccessWorkspaceFactoryClass();
            IWorkspace pWorkSpace = workspaceFactory.OpenFromFile(m_workspacePath, 0);
            //IWorkspace pWorkSpace = workspaceFactory.OpenFromFile(@"F:\成果检查\DataCheckApp\CheckData\数据库成果\县级耕地质量等级成果补充完善数据库.mdb", 0);
            if (pWorkSpace == null)
                return null;
            IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)pWorkSpace;
            IEnumDataset pEnumDataset;
            IEnumFeatureClass pEnumFeatureClass;
            IFeatureClassContainer pFeatureclassContainer;
            IDataset pDataset;
            IFeatureClass pFeatureClass;
            pFeatureClass = null;
            IFeatureDataset pFeatureDataset;
            IWorkspace2 pWorkspace2;
            pWorkspace2 = (IWorkspace2)pWorkSpace;
            pEnumDataset = (IEnumDataset)pWorkSpace.get_Datasets(esriDatasetType.esriDTFeatureDataset);//获得MDB端的所有数据集
            pDataset = (IDataset)pEnumDataset.Next();
            IFeatureLayer m_featureLayer = new FeatureLayer();
            while (pDataset != null)//遍历数据集
            {
                pFeatureDataset = (IFeatureDataset)pDataset;
                if (pFeatureDataset != null)
                {
                    pFeatureclassContainer = (IFeatureClassContainer)pFeatureDataset;
                    pEnumFeatureClass = (IEnumFeatureClass)pFeatureclassContainer.Classes;
                    pFeatureClass = (IFeatureClass)pEnumFeatureClass.Next();
                    while (pFeatureClass != null)//在每一个数据集中遍历数据层IFeatureClass
                    {
                        break;
                    }
                    break;
                }
            }
            return pFeatureClass;
        }

        /// <summary> 检查耕作制度的正确性、地类代码的正确性、各个作物名称的正确性、耕作制度与地类编码的对应的正确性和作物与耕作制度的对应的正确性
        /// </summary>
        /// <param name="m_workspacePath"></param>
        /// <returns></returns>
        public DataTable getDtFromCheckGengzuozhidu(string m_workspacePath)
        {
            IWorkspaceFactory workspaceFactory = new AccessWorkspaceFactoryClass();
            IWorkspace pWorkSpace = workspaceFactory.OpenFromFile(m_workspacePath, 0);
            //IWorkspace pWorkSpace = workspaceFactory.OpenFromFile(@"F:\成果检查\DataCheckApp\CheckData\数据库成果\县级耕地质量等级成果补充完善数据库.mdb", 0);
            if (pWorkSpace == null)
                return null;
            IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)pWorkSpace;
            IEnumDataset pEnumDataset;
            IEnumFeatureClass pEnumFeatureClass;
            IFeatureClassContainer pFeatureclassContainer;
            IDataset pDataset;
            IFeatureClass pFeatureClass;
            pFeatureClass = null;
            IFeatureDataset pFeatureDataset;
            IWorkspace2 pWorkspace2;
            pWorkspace2 = (IWorkspace2)pWorkSpace;
            pEnumDataset = (IEnumDataset)pWorkSpace.get_Datasets(esriDatasetType.esriDTFeatureDataset);//获得MDB端的所有数据集
            pDataset = (IDataset)pEnumDataset.Next();
            IFeatureLayer m_featureLayer = new FeatureLayer();
            while (pDataset != null)//遍历数据集
            {
                pFeatureDataset = (IFeatureDataset)pDataset;
                if (pFeatureDataset != null)
                {
                    pFeatureclassContainer = (IFeatureClassContainer)pFeatureDataset;
                    pEnumFeatureClass = (IEnumFeatureClass)pFeatureclassContainer.Classes;
                    pFeatureClass = (IFeatureClass)pEnumFeatureClass.Next();
                    while (pFeatureClass != null)//在每一个数据集中遍历数据层IFeatureClass
                    {
                        break;
                    }
                    break;
                }
            }

            DataTable gzzdChkResultDt = new DataTable();
            DataColumn column = new DataColumn("县名称");
            gzzdChkResultDt.Columns.Add(column);
            column = new DataColumn("乡镇");
            gzzdChkResultDt.Columns.Add(column);
            column = new DataColumn("县级分等单元编号");
            gzzdChkResultDt.Columns.Add(column);
            column = new DataColumn("耕作制度");
            gzzdChkResultDt.Columns.Add(column);
            column = new DataColumn("地类代码");
            gzzdChkResultDt.Columns.Add(column);
            column = new DataColumn("作物名称");
            gzzdChkResultDt.Columns.Add(column);
            column = new DataColumn("检查结果");
            gzzdChkResultDt.Columns.Add(column);

            List<string> DLDMHanDi = m_readConfig.GetAttributeValueListFromAttributeName("DLDMHanDi", "value");
            List<string> DLDMShuiTian = m_readConfig.GetAttributeValueListFromAttributeName("DLDMShuiTian", "value");
            List<string> gzzdList = m_readConfig.GetAttributeValueListFromAttributeName("gzzdList", "value");

            IQueryFilter queryFilter = new QueryFilter();
            IFeatureCursor featureCursor = pFeatureClass.Search(null, true);
            IFeature feature = featureCursor.NextFeature();
            if (feature == null) return null;

            string DLDM = null;
            string GJGZZD = null;

            string JZZWMC = null;
            string ZDZW1MC = null;
            string ZDZW2MC = null;
            string ZDZW3MC = null;
            string ZDZW4MC = null;

            string JZGWZS = null;
            string ZDZW1GW = null;
            string ZDZW2GW = null;
            string ZDZW3QH = null;
            string ZDZW4QH = null;

            bool isDLDMError = false;
            bool isGJGZZDError = false;

            while (feature != null)
            {
                GJGZZD = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                DLDM = feature.get_Value(feature.Fields.FindField("DLDM")).ToString();

                JZZWMC = feature.get_Value(feature.Fields.FindField("JZZWMC")).ToString().Trim();
                ZDZW1MC = feature.get_Value(feature.Fields.FindField("ZDZW1MC")).ToString().Trim();
                ZDZW2MC = feature.get_Value(feature.Fields.FindField("ZDZW2MC")).ToString().Trim();
                ZDZW3MC = feature.get_Value(feature.Fields.FindField("ZDZW3MC")).ToString().Trim();
                ZDZW4MC = feature.get_Value(feature.Fields.FindField("ZDZW4MC")).ToString().Trim();

                JZGWZS = feature.get_Value(feature.Fields.FindField("JZGWZS")).ToString().Trim();
                ZDZW1GW = feature.get_Value(feature.Fields.FindField("ZDZW1GW")).ToString().Trim();
                ZDZW2GW = feature.get_Value(feature.Fields.FindField("ZDZW2GW")).ToString().Trim();
                ZDZW3QH = feature.get_Value(feature.Fields.FindField("ZDZW3QH")).ToString().Trim();
                ZDZW4QH = feature.get_Value(feature.Fields.FindField("ZDZW4QH")).ToString().Trim();

                #region 检查耕作制度的正确性
                isGJGZZDError = true;
                for (int i = 0; i < gzzdList.Count; i++)
                {
                    if (GJGZZD.Equals(gzzdList[i]))
                    {
                        isGJGZZDError = false;
                    }
                }
                if (isGJGZZDError)
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["检查结果"] = "耕作制度" + feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                #endregion

                #region 检查地类代码的正确性
                isDLDMError = true;
                for (int i = 0; i < DLDMShuiTian.Count; i++)
                {
                    if (DLDM.Equals(DLDMShuiTian[i]))
                    {
                        isDLDMError = false;
                    }
                }
                for (int i = 0; i < DLDMHanDi.Count; i++)
                {
                    if (DLDM.Equals(DLDMHanDi[i]))
                    {
                        isDLDMError = false;
                    }
                }
                if (isDLDMError)
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["地类代码"] = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                    newRow["检查结果"] = "地类代码" + feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                #endregion

                #region 检查作物名称的正确性
                if (!JZZWMC.Equals("晚稻"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("JZZWMC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("JZZWMC")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (!ZDZW1MC.Equals("早稻"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW1MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW1MC")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (!ZDZW2MC.Equals("冬甘薯"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW2MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW2MC")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (!ZDZW3MC.Equals("春花生"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW3MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW3MC")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (!ZDZW4MC.Equals("秋甘薯"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW4MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW4MC")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                #endregion

                #region 判断耕作制度与地类代码的对应的正确性
                for (int i = 0; i < DLDMHanDi.Count; i++)
                {
                    if (DLDM.Equals(DLDMHanDi[i]) && !GJGZZD.Equals(gzzdList[1]))
                    {
                        DataRow newRow = gzzdChkResultDt.NewRow();
                        newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                        newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                        newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                        newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                        newRow["地类代码"] = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                        newRow["检查结果"] = "耕作制度与地类代码不对应";
                        gzzdChkResultDt.Rows.Add(newRow);
                    }
                }
                for (int i = 0; i < DLDMShuiTian.Count; i++)
                {
                    if (DLDM.Equals(DLDMShuiTian[i]) && !GJGZZD.Equals(gzzdList[0]))
                    {
                        DataRow newRow = gzzdChkResultDt.NewRow();
                        newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                        newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                        newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                        newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                        newRow["地类代码"] = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                        newRow["检查结果"] = "耕作制度与地类代码不对应";
                        gzzdChkResultDt.Rows.Add(newRow);
                    }
                }
                #endregion

                #region 检查作物是否与耕作制度对应
                if (GJGZZD.Contains("稻") && (JZGWZS.Equals("0")))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("JZZWMC")).ToString().Trim();
                    newRow["检查结果"] = "作物" + feature.get_Value(feature.Fields.FindField("JZZWMC")).ToString().Trim() + "与耕作制度不对应";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (GJGZZD.Contains("稻") && ZDZW1GW.Equals("0"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW1MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW1MC")).ToString().Trim() + "与耕作制度不对应";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (GJGZZD.Contains("稻") && ZDZW2GW.Equals("0"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW2MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW2MC")).ToString().Trim() + "与耕作制度不对应";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (GJGZZD.Contains("春花生") && ZDZW3QH.Equals("0"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW3MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW3MC")).ToString().Trim() + "与耕作制度不对应";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (GJGZZD.Contains("秋甘薯") && ZDZW4QH.Equals("0"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW4MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW4MC")).ToString().Trim() + "与耕作制度不对应";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                #endregion

                feature = featureCursor.NextFeature();
            }
            return gzzdChkResultDt;
        }

        /// <summary> 检查耕作制度的正确性、地类代码的正确性、各个作物名称的正确性、耕作制度与地类编码的对应的正确性和作物与耕作制度的对应的正确性
        /// </summary>
        /// <param name="m_workspacePath"></param>
        /// <param name="m_featureLayerName"></param>
        /// <returns></returns>
        public DataTable getDtFromCheckGengzuozhidu(IFeatureClass featureClass)
        {
            DataTable gzzdChkResultDt = new DataTable();
            DataColumn column = new DataColumn("县名称");
            gzzdChkResultDt.Columns.Add(column);
            column = new DataColumn("乡镇");
            gzzdChkResultDt.Columns.Add(column);
            column = new DataColumn("县级分等单元编号");
            gzzdChkResultDt.Columns.Add(column);
            column = new DataColumn("耕作制度");
            gzzdChkResultDt.Columns.Add(column);
            column = new DataColumn("地类代码");
            gzzdChkResultDt.Columns.Add(column);
            column = new DataColumn("作物名称");
            gzzdChkResultDt.Columns.Add(column);
            column = new DataColumn("检查结果");
            gzzdChkResultDt.Columns.Add(column);

            List<string> DLDMHanDi = m_readConfig.GetAttributeValueListFromAttributeName("DLDMHanDi", "value");
            List<string> DLDMShuiTian = m_readConfig.GetAttributeValueListFromAttributeName("DLDMShuiTian", "value");
            List<string> gzzdList = m_readConfig.GetAttributeValueListFromAttributeName("gzzdList", "value");

            IQueryFilter queryFilter = new QueryFilter();
            IFeatureCursor featureCursor = featureClass.Search(null, true);
            IFeature feature = featureCursor.NextFeature();
            if (feature == null) return null;

            string DLDM = null;
            string GJGZZD = null;

            string JZZWMC = null;
            string ZDZW1MC = null;
            string ZDZW2MC = null;
            string ZDZW3MC = null;
            string ZDZW4MC = null;

            string JZGWZS = null;
            string ZDZW1GW = null;
            string ZDZW2GW = null;
            string ZDZW3QH = null;
            string ZDZW4QH = null;

            bool isDLDMError = false;
            bool isGJGZZDError = false;

            while (feature != null)
            {
                GJGZZD = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                DLDM = feature.get_Value(feature.Fields.FindField("DLDM")).ToString();

                JZZWMC = feature.get_Value(feature.Fields.FindField("JZZWMC")).ToString().Trim();
                ZDZW1MC = feature.get_Value(feature.Fields.FindField("ZDZW1MC")).ToString().Trim();
                ZDZW2MC = feature.get_Value(feature.Fields.FindField("ZDZW2MC")).ToString().Trim();
                ZDZW3MC = feature.get_Value(feature.Fields.FindField("ZDZW3MC")).ToString().Trim();
                ZDZW4MC = feature.get_Value(feature.Fields.FindField("ZDZW4MC")).ToString().Trim();

                JZGWZS = feature.get_Value(feature.Fields.FindField("JZGWZS")).ToString().Trim();
                ZDZW1GW = feature.get_Value(feature.Fields.FindField("ZDZW1GW")).ToString().Trim();
                ZDZW2GW = feature.get_Value(feature.Fields.FindField("ZDZW2GW")).ToString().Trim();
                ZDZW3QH = feature.get_Value(feature.Fields.FindField("ZDZW3QH")).ToString().Trim();
                ZDZW4QH = feature.get_Value(feature.Fields.FindField("ZDZW4QH")).ToString().Trim();

                #region 检查耕作制度的正确性
                isGJGZZDError = true;
                for (int i = 0; i < gzzdList.Count; i++)
                {
                    if (GJGZZD.Equals(gzzdList[i]))
                    {
                        isGJGZZDError = false;
                    }
                }
                if (isGJGZZDError)
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["检查结果"] = "耕作制度" + feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                #endregion

                #region 检查地类代码的正确性
                isDLDMError = true;
                for (int i = 0; i < DLDMShuiTian.Count; i++)
                {
                    if (DLDM.Equals(DLDMShuiTian[i]))
                    {
                        isDLDMError = false;
                    }
                }
                for (int i = 0; i < DLDMHanDi.Count; i++)
                {
                    if (DLDM.Equals(DLDMHanDi[i]))
                    {
                        isDLDMError = false;
                    }
                }
                if (isDLDMError)
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["地类代码"] = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                    newRow["检查结果"] = "地类代码" + feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                #endregion

                #region 检查作物名称的正确性
                if (!JZZWMC.Equals("晚稻"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("JZZWMC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("JZZWMC")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (!ZDZW1MC.Equals("早稻"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW1MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW1MC")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (!ZDZW2MC.Equals("冬甘薯"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW2MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW2MC")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (!ZDZW3MC.Equals("春花生"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW3MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW3MC")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (!ZDZW4MC.Equals("秋甘薯"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW4MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW4MC")).ToString().Trim() + "不正确";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                #endregion

                #region 判断耕作制度与地类代码的对应的正确性
                for (int i = 0; i < DLDMHanDi.Count; i++)
                {
                    if (DLDM.Equals(DLDMHanDi[i]) && !GJGZZD.Equals(gzzdList[1]))
                    {
                        DataRow newRow = gzzdChkResultDt.NewRow();
                        newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                        newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                        newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                        newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                        newRow["地类代码"] = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                        newRow["检查结果"] = "耕作制度与地类代码不对应";
                        gzzdChkResultDt.Rows.Add(newRow);
                    }
                }
                for (int i = 0; i < DLDMShuiTian.Count; i++)
                {
                    if (DLDM.Equals(DLDMShuiTian[i]) && !GJGZZD.Equals(gzzdList[0]))
                    {
                        DataRow newRow = gzzdChkResultDt.NewRow();
                        newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                        newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                        newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                        newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                        newRow["地类代码"] = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                        newRow["检查结果"] = "耕作制度与地类代码不对应";
                        gzzdChkResultDt.Rows.Add(newRow);
                    }
                }
                #endregion

                #region 检查作物是否与耕作制度对应
                if (GJGZZD.Contains("稻") && (JZGWZS.Equals("0")))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("JZZWMC")).ToString().Trim();
                    newRow["检查结果"] = "作物" + feature.get_Value(feature.Fields.FindField("JZZWMC")).ToString().Trim() + "与耕作制度不对应";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (GJGZZD.Contains("稻") && ZDZW1GW.Equals("0"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW1MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW1MC")).ToString().Trim() + "与耕作制度不对应";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (GJGZZD.Contains("稻") && ZDZW2GW.Equals("0"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW2MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW2MC")).ToString().Trim() + "与耕作制度不对应";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (GJGZZD.Contains("春花生") && ZDZW3QH.Equals("0"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW3MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW3MC")).ToString().Trim() + "与耕作制度不对应";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                if (GJGZZD.Contains("秋甘薯") && ZDZW4QH.Equals("0"))
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow["县名称"] = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                    newRow["乡镇"] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow["县级分等单元编号"] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow["耕作制度"] = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    newRow["作物名称"] = feature.get_Value(feature.Fields.FindField("ZDZW4MC")).ToString().Trim();
                    newRow["检查结果"] = "作物名称" + feature.get_Value(feature.Fields.FindField("ZDZW4MC")).ToString().Trim() + "与耕作制度不对应";
                    gzzdChkResultDt.Rows.Add(newRow);
                }
                #endregion

                feature = featureCursor.NextFeature();
            }
            return gzzdChkResultDt;
        }

        #region 参数检查
        public DataTable GetGZZDFQCheckResultDt(IFeatureClass featureClass)//参数检查：耕作制度分区
        {
            try
            {
                IQueryFilter queryFilter = new QueryFilter();
                IFeatureCursor featureCursor = featureClass.Search(null, true);
                IFeature feature = featureCursor.NextFeature();
                if (feature == null) return null;
                string xmc = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                DataTable gzzdfqDt = new DataTable();
                string sql = "select * from zd_gengzuozhidufenqu where QXNAME = '" + xmc + "'";
                gzzdfqDt = m_dicAccessDB.getDataTable(sql);
                DataTable gzzdfqChkResultDt = new DataTable();
                DataColumn column = new DataColumn("县名称");
                gzzdfqChkResultDt.Columns.Add(column);
                column = new DataColumn("乡镇");
                gzzdfqChkResultDt.Columns.Add(column);
                column = new DataColumn("县级分等单元编号");
                gzzdfqChkResultDt.Columns.Add(column);
                column = new DataColumn("参数名称");
                gzzdfqChkResultDt.Columns.Add(column);
                column = new DataColumn("检查结果");
                gzzdfqChkResultDt.Columns.Add(column);
                if (gzzdfqDt.Rows.Count < 1)
                {
                    DataRow newRow = gzzdfqChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow[3] = "省二级区";
                    newRow[4] = "参考字典表中无该区县记录";
                    gzzdfqChkResultDt.Rows.Add(newRow);
                    return gzzdfqChkResultDt;
                }
                while (feature != null)
                {
                    string gzzdfq = feature.get_Value(feature.Fields.FindField("EJQMC")).ToString().Trim();
                    if (!gzzdfqDt.Rows[0]["ProvinceSecondRegion"].ToString().Equals(gzzdfq))
                    {
                        DataRow newRow = gzzdfqChkResultDt.NewRow();
                        newRow[0] = xmc;
                        newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                        newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                        newRow[3] = "省二级区";
                        newRow[4] = "选择不正确";
                        gzzdfqChkResultDt.Rows.Add(newRow);
                    }
                    feature = featureCursor.NextFeature();
                }
                return gzzdfqChkResultDt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }

        public DataTable GetGZZDCheckResultDt(IFeatureClass featureClass)//参数检查：耕作制度检查
        {
            try
            {
                IQueryFilter queryFilter = new QueryFilter();
                IFeatureCursor featureCursor = featureClass.Search(null, true);
                IFeature feature = featureCursor.NextFeature();
                if (feature == null) return null;
                string xmc = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                DataTable gzzdDt = new DataTable();
                string sql = "select * from zd_gengzuozhidu where QXNAME = '" + xmc + "'";
                gzzdDt = m_dicAccessDB.getDataTable(sql);
                DataTable gzzdChkResultDt = new DataTable();
                DataColumn column = new DataColumn("县名称");
                gzzdChkResultDt.Columns.Add(column);
                column = new DataColumn("乡镇");
                gzzdChkResultDt.Columns.Add(column);
                column = new DataColumn("县级分等单元编号");
                gzzdChkResultDt.Columns.Add(column);
                column = new DataColumn("参数名称");
                gzzdChkResultDt.Columns.Add(column);
                column = new DataColumn("检查结果");
                gzzdChkResultDt.Columns.Add(column);
                if (gzzdDt.Rows.Count < 1)
                {
                    DataRow newRow = gzzdChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow[3] = "耕作制度";
                    newRow[4] = "参考字典表无该区县记录";
                    gzzdChkResultDt.Rows.Add(newRow);
                    return gzzdChkResultDt;
                }
                while (feature != null)
                {
                    string gzzd = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    gzzd = gzzd.Replace("-", "-"); //将“-”转为"-"; 
                    gzzd = gzzd.Replace(" -", "-"); //将“-”转为"-";
                    gzzd = gzzd.Replace("- ", "-"); //将“-”转为"-";
                    gzzd = gzzd.Replace(" - ", "-"); //将“-”转为"-";
                    if (!(gzzdDt.Rows[0]["gengzuozhidu1"].ToString().Equals(gzzd) || gzzdDt.Rows[0]["gengzuozhidu2"].ToString().Equals(gzzd)))
                    {
                        DataRow newRow = gzzdChkResultDt.NewRow();
                        newRow[0] = xmc;
                        newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                        newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                        newRow[3] = "耕作制度";
                        newRow[4] = "选择不正确";
                        gzzdChkResultDt.Rows.Add(newRow);
                    }
                    feature = featureCursor.NextFeature();
                }
                return gzzdChkResultDt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }

        public DataTable GetgwqlzsCheckResultDt(IFeatureClass featureClass)//参数检查：光温潜力指数检查（水田作物选择该指数）
        {
            try
            {
                string[] dldmArray = { "114", "011", "012" };
                IQueryFilter queryFilter = new QueryFilter();
                IFeatureCursor featureCursor = featureClass.Search(null, true);
                IFeature feature = featureCursor.NextFeature();
                if (feature == null) return null;
                string xmc = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                DataTable gwqlDt = new DataTable();
                string sql = "select * from zd_guangwenqianli where QXNAME = '" + xmc + "'";
                gwqlDt = m_dicAccessDB.getDataTable(sql);
                DataTable gwqlzsChkResultDt = new DataTable();
                DataColumn column = new DataColumn("县名称");
                gwqlzsChkResultDt.Columns.Add(column);
                column = new DataColumn("乡镇");
                gwqlzsChkResultDt.Columns.Add(column);
                column = new DataColumn("县级分等单元编号");
                gwqlzsChkResultDt.Columns.Add(column);
                column = new DataColumn("参数名称");
                gwqlzsChkResultDt.Columns.Add(column);
                column = new DataColumn("检查结果");
                gwqlzsChkResultDt.Columns.Add(column);
                if (gwqlDt.Rows.Count < 1)
                {
                    DataRow newRow = gwqlzsChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow[3] = "光温潜力指数";
                    newRow[4] = "参考字典表无该区县记录";
                    gwqlzsChkResultDt.Rows.Add(newRow);
                    return gwqlzsChkResultDt;
                }
                while (feature != null)
                {
                    string dldm = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                    if (dldmArray.Contains(dldm))
                    {
                        string jzgwzs = feature.get_Value(feature.Fields.FindField("JZGWZS")).ToString().Trim();//晚稻
                        string zdzw1gw = feature.get_Value(feature.Fields.FindField("ZDZW1GW")).ToString().Trim();//早稻
                        string zdzw2gw = feature.get_Value(feature.Fields.FindField("ZDZW2GW")).ToString().Trim();//冬甘薯
                        if (!(gwqlDt.Rows[0]["wandao"].ToString().Equals(jzgwzs) && gwqlDt.Rows[0]["zaodao"].ToString().Contains(zdzw1gw) && gwqlDt.Rows[0]["dongganshu"].ToString().Equals(zdzw2gw)))
                        {
                            DataRow newRow = gwqlzsChkResultDt.NewRow();
                            newRow[0] = xmc;
                            newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                            newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                            newRow[3] = "光温潜力指数";
                            newRow[4] = "选择不正确";
                            gwqlzsChkResultDt.Rows.Add(newRow);
                        }
                    }
                    feature = featureCursor.NextFeature();
                }
                return gwqlzsChkResultDt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }

        public DataTable GetqhqlzsCheckResultDt(IFeatureClass featureClass)//参数检查：气候潜力指数检查（旱地作物选择该指数）
        {
            try
            {
                string[] dldmArray = { "022", "021", "013", "033", "023", "031" };
                IQueryFilter queryFilter = new QueryFilter();
                IFeatureCursor featureCursor = featureClass.Search(null, true);
                IFeature feature = featureCursor.NextFeature();
                if (feature == null) return null;
                string xmc = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                DataTable qhqlDt = new DataTable();
                string sql = "select * from zd_qihouqianli where QXNAME = '" + xmc + "'";
                qhqlDt = m_dicAccessDB.getDataTable(sql);
                DataTable qhqlzsChkResultDt = new DataTable();
                DataColumn column = new DataColumn("县名称");
                qhqlzsChkResultDt.Columns.Add(column);
                column = new DataColumn("乡镇");
                qhqlzsChkResultDt.Columns.Add(column);
                column = new DataColumn("县级分等单元编号");
                qhqlzsChkResultDt.Columns.Add(column);
                column = new DataColumn("参数名称");
                qhqlzsChkResultDt.Columns.Add(column);
                column = new DataColumn("检查结果");
                qhqlzsChkResultDt.Columns.Add(column);
                if (qhqlDt.Rows.Count < 1)
                {
                    DataRow newRow = qhqlzsChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow[3] = "气候潜力指数";
                    newRow[4] = "参考字典表无该区县记录";
                    qhqlzsChkResultDt.Rows.Add(newRow);
                    return qhqlzsChkResultDt;
                }
                while (feature != null)
                {
                    string dldm = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                    if (dldmArray.Contains(dldm))
                    {
                        string zdzw3qh = feature.get_Value(feature.Fields.FindField("ZDZW3QH")).ToString().Trim();//春花生
                        string zdzw4qh = feature.get_Value(feature.Fields.FindField("ZDZW4QH")).ToString().Trim();//秋甘薯
                        if (!(qhqlDt.Rows[0]["chunhuasheng"].ToString().Equals(zdzw3qh) && qhqlDt.Rows[0]["qiuganshu"].ToString().Equals(zdzw4qh)))
                        {
                            DataRow newRow = qhqlzsChkResultDt.NewRow();
                            newRow[0] = xmc;
                            newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                            newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                            newRow[3] = "气候潜力指数";
                            newRow[4] = "选择不正确";
                            qhqlzsChkResultDt.Rows.Add(newRow);
                        }
                    }
                    feature = featureCursor.NextFeature();
                }
                return qhqlzsChkResultDt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }

        public DataTable GetclbxuCheckResultDt(IFeatureClass featureClass)//参数检查：产量比系数检查
        {
            try
            {
                string[] dldmArray = { "022", "021", "013", "033", "023", "031" };
                IQueryFilter queryFilter = new QueryFilter();
                IFeatureCursor featureCursor = featureClass.Search(null, true);
                IFeature feature = featureCursor.NextFeature();
                if (feature == null) return null;
                string ejq = feature.get_Value(feature.Fields.FindField("EJQMC")).ToString().Trim();
                DataTable clbxsDt = new DataTable();
                string sql = "select * from zd_chanliangbixishu where erjiqu = '" + ejq + "'";
                clbxsDt = m_dicAccessDB.getDataTable(sql);
                DataTable clbxsChkResultDt = new DataTable();
                DataColumn column = new DataColumn("县名称");
                clbxsChkResultDt.Columns.Add(column);
                column = new DataColumn("乡镇");
                clbxsChkResultDt.Columns.Add(column);
                column = new DataColumn("县级分等单元编号");
                clbxsChkResultDt.Columns.Add(column);
                column = new DataColumn("参数名称");
                clbxsChkResultDt.Columns.Add(column);
                column = new DataColumn("检查结果");
                clbxsChkResultDt.Columns.Add(column);
                if (clbxsDt.Rows.Count < 1)
                {
                    DataRow newRow = clbxsChkResultDt.NewRow();
                    newRow[0] = ejq;
                    newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow[3] = "产量比系数";
                    newRow[4] = "参考字典表无该区县记录";
                    clbxsChkResultDt.Rows.Add(newRow);
                    return clbxsChkResultDt;
                }
                while (feature != null)
                {
                    string dldm = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                    if (dldmArray.Contains(dldm))//春花生，秋甘薯有值
                    {
                        string zdzw3b = feature.get_Value(feature.Fields.FindField("ZDZW3B")).ToString().Trim();//春花生
                        string zdzw4b = feature.get_Value(feature.Fields.FindField("ZDZW4B")).ToString().Trim();//秋甘薯
                        if (!(clbxsDt.Rows[0]["chunhuasheng"].ToString().Equals(zdzw3b) && clbxsDt.Rows[0]["qiuganshu"].ToString().Equals(zdzw4b)))
                        {
                            DataRow newRow = clbxsChkResultDt.NewRow();
                            newRow[0] = ejq;
                            newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                            newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                            newRow[3] = "产量比系数";
                            newRow[4] = "选择不正确";
                            clbxsChkResultDt.Rows.Add(newRow);
                        }
                    }
                    else
                    {
                        string zdzw1b = feature.get_Value(feature.Fields.FindField("ZDZW1B")).ToString().Trim();//早稻
                        string zdzw2b = feature.get_Value(feature.Fields.FindField("ZDZW2B")).ToString().Trim();//冬甘薯
                        if (!(clbxsDt.Rows[0]["zaodao"].ToString().Equals(zdzw1b) && clbxsDt.Rows[0]["dongganshu"].ToString().Equals(zdzw2b)))
                        {
                            DataRow newRow = clbxsChkResultDt.NewRow();
                            newRow[0] = ejq;
                            newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                            newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                            newRow[3] = "产量比系数";
                            newRow[4] = "选择不正确";
                            clbxsChkResultDt.Rows.Add(newRow);
                        }
                    }
                    feature = featureCursor.NextFeature();
                }
                return clbxsChkResultDt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }

        public DataTable GettdlyxsCheckResultDt(IFeatureClass featureClass)//参数检查：土地利用系数检查
        {
            try
            {
                string[] dldmArray = { "022", "021", "013", "033", "023", "031" };
                IQueryFilter queryFilter = new QueryFilter();
                IFeatureCursor featureCursor = featureClass.Search(null, true);
                IFeature feature = featureCursor.NextFeature();
                if (feature == null) return null;
                string xmc = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                DataTable tdlyxsChkResultDt = new DataTable();
                DataColumn column = new DataColumn("县名称");
                tdlyxsChkResultDt.Columns.Add(column);
                column = new DataColumn("乡镇");
                tdlyxsChkResultDt.Columns.Add(column);
                column = new DataColumn("县级分等单元编号");
                tdlyxsChkResultDt.Columns.Add(column);
                column = new DataColumn("参数名称");
                tdlyxsChkResultDt.Columns.Add(column);
                column = new DataColumn("检查结果");
                tdlyxsChkResultDt.Columns.Add(column);
                while (feature != null)
                {
                    string dldm = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                    string xz = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    DataTable tdlyxsDt = new DataTable();
                    string sql = "select * from zd_liyonghejingjidengzhiqu where xingzhengxiaqu = '" + xz + "'";
                    tdlyxsDt = m_dicAccessDB.getDataTable(sql);
                    if (tdlyxsDt.Rows.Count < 1)
                    {
                        DataRow newRow = tdlyxsChkResultDt.NewRow();
                        newRow[0] = xmc;
                        newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                        newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                        newRow[3] = "土地利用系数";
                        newRow[4] = "参考字典表无此记录";
                        tdlyxsChkResultDt.Rows.Add(newRow);
                    }
                    else
                    {
                        string tdlyxs = feature.get_Value(feature.Fields.FindField("TDLYXS")).ToString().Trim();
                        if (dldmArray.Contains(dldm))
                        {
                            if (!tdlyxs.Contains(tdlyxsDt.Rows[0]["handiliyongdengzhiquxishu"].ToString()))
                            {
                                DataRow newRow = tdlyxsChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                                newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                                newRow[3] = "土地利用系数";
                                newRow[4] = "选择不正确";
                                tdlyxsChkResultDt.Rows.Add(newRow);
                            }
                        }
                        else
                        {
                            if (!tdlyxs.Contains(tdlyxsDt.Rows[0]["shuitianliyongdengzhiquxishu"].ToString()))
                            {
                                DataRow newRow = tdlyxsChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                                newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                                newRow[3] = "土地利用系数系数";
                                newRow[4] = "选择不正确";
                                tdlyxsChkResultDt.Rows.Add(newRow);
                            }
                        }
                    }
                    feature = featureCursor.NextFeature();
                }
                return tdlyxsChkResultDt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }

        public DataTable GettdjjxsCheckResultDt(IFeatureClass featureClass)//参数检查：土地经济系数检查
        {
            try
            {
                string[] dldmArray = { "022", "021", "013", "033", "023", "031" };
                IQueryFilter queryFilter = new QueryFilter();
                IFeatureCursor featureCursor = featureClass.Search(null, true);
                IFeature feature = featureCursor.NextFeature();
                if (feature == null) return null;
                string xmc = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                DataTable tdjjxsChkResultDt = new DataTable();
                DataColumn column = new DataColumn("县名称");
                tdjjxsChkResultDt.Columns.Add(column);
                column = new DataColumn("乡镇");
                tdjjxsChkResultDt.Columns.Add(column);
                column = new DataColumn("县级分等单元编号");
                tdjjxsChkResultDt.Columns.Add(column);
                column = new DataColumn("参数名称");
                tdjjxsChkResultDt.Columns.Add(column);
                column = new DataColumn("检查结果");
                tdjjxsChkResultDt.Columns.Add(column);
                while (feature != null)
                {
                    string dldm = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                    string xz = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    DataTable tdjjxsDt = new DataTable();
                    string sql = "select * from zd_liyonghejingjidengzhiqu where xingzhengxiaqu = '" + xz + "'";
                    tdjjxsDt = m_dicAccessDB.getDataTable(sql);
                    string tdlyxs = feature.get_Value(feature.Fields.FindField("TDJJXS")).ToString().Trim();
                    if (tdjjxsDt.Rows.Count < 1)
                    {
                        DataRow newRow = tdjjxsChkResultDt.NewRow();
                        newRow[0] = xmc;
                        newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                        newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                        newRow[3] = "土地利用系数";
                        newRow[4] = "参考字典表无此记录";
                        tdjjxsChkResultDt.Rows.Add(newRow);
                    }
                    else
                    {
                        if (dldmArray.Contains(dldm))
                        {
                            if (!tdlyxs.Contains(tdjjxsDt.Rows[0]["handijingjidegnzhiquxishu"].ToString()))
                            {
                                DataRow newRow = tdjjxsChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                                newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                                newRow[3] = "土地经济系数";
                                newRow[4] = "选择不正确";
                                tdjjxsChkResultDt.Rows.Add(newRow);
                            }
                        }
                        else
                        {
                            if (!tdlyxs.Contains(tdjjxsDt.Rows[0]["shuitianjingjidengzhiquxishu"].ToString()))
                            {
                                DataRow newRow = tdjjxsChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                                newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                                newRow[3] = "土地经济系数";
                                newRow[4] = "选择不正确";
                                tdjjxsChkResultDt.Rows.Add(newRow);
                            }
                        }
                    }
                    feature = featureCursor.NextFeature();
                }
                return tdjjxsChkResultDt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }

        public DataTable GetReferenceIndexCheckResultDt(IFeatureClass featureClass)//各参数汇总检查
        {
            try
            {
                #region 初始化结果表列
                DataTable referenceIndexChkResultDt = new DataTable();
                DataColumn column = new DataColumn("县名称");
                referenceIndexChkResultDt.Columns.Add(column);
                column = new DataColumn("乡镇");
                referenceIndexChkResultDt.Columns.Add(column);
                column = new DataColumn("县级分等单元编号");
                referenceIndexChkResultDt.Columns.Add(column);
                column = new DataColumn("参数名称");
                referenceIndexChkResultDt.Columns.Add(column);
                column = new DataColumn("检查结果");
                referenceIndexChkResultDt.Columns.Add(column);
                #endregion
                IQueryFilter queryFilter = new QueryFilter();
                IFeatureCursor featureCursor = featureClass.Search(null, true);
                IFeature feature = featureCursor.NextFeature();

                if (feature == null) return null;
                string[] dldmArray = { "114", "011", "012" }; //地类编码作为水田的地类代码数组

                #region 读取各参数标准的字典表
                string xmc = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();//获取数据库的县名称
                //耕作制度分区标准参考字典表
                DataTable gzzdfqDt = new DataTable();
                string sqlgzzdfq = "select * from zd_gengzuozhidufenqu where QXNAME = '" + xmc + "'";
                gzzdfqDt = m_dicAccessDB.getDataTable(sqlgzzdfq);
                if (gzzdfqDt.Rows.Count < 1)
                {
                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow[3] = "省二级区";
                    newRow[4] = "参考字典表中无此区县记录";
                    referenceIndexChkResultDt.Rows.Add(newRow);
                }
                //耕作制度标准参考字典表
                DataTable gzzdDt = new DataTable();
                string sqlgzzd = "select * from zd_gengzuozhidu where QXNAME = '" + xmc + "'";
                gzzdDt = m_dicAccessDB.getDataTable(sqlgzzd);
                if (gzzdDt.Rows.Count < 1)
                {
                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow[3] = "耕作制度";
                    newRow[4] = "参考字典表中无此区县记录";
                    referenceIndexChkResultDt.Rows.Add(newRow);
                }
                //光温潜力指数标准参考字典表
                DataTable gwqlDt = new DataTable();
                string sqlgwql = "select * from zd_guangwenqianli where QXNAME = '" + xmc + "'";
                gwqlDt = m_dicAccessDB.getDataTable(sqlgwql);
                if (gwqlDt.Rows.Count < 1)
                {
                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow[3] = "光温潜力指数";
                    newRow[4] = "参考字典表中无该区县记录";
                    referenceIndexChkResultDt.Rows.Add(newRow);
                }
                //气候潜力指数标准参考字典表
                DataTable qhqlDt = new DataTable();
                string sqlqhql = "select * from zd_qihouqianli where QXNAME = '" + xmc + "'";
                qhqlDt = m_dicAccessDB.getDataTable(sqlqhql);
                if (qhqlDt.Rows.Count < 1)
                {
                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow[3] = "气候潜力指数";
                    newRow[4] = "参考字典表中无此区县记录";
                    referenceIndexChkResultDt.Rows.Add(newRow);
                }
                //产量比系数标准参考字典表
                string ejq = feature.get_Value(feature.Fields.FindField("EJQMC")).ToString().Trim();
                DataTable clbxsDt = new DataTable();
                string sqlclbxs = "select * from zd_chanliangbixishu where erjiqu = '" + ejq + "'";
                clbxsDt = m_dicAccessDB.getDataTable(sqlclbxs);
                if (clbxsDt.Rows.Count < 1)
                {
                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                    newRow[0] = ejq;
                    newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    newRow[3] = "产量比系数";
                    newRow[4] = "参考字典表中无此区县记录";
                    referenceIndexChkResultDt.Rows.Add(newRow);
                }
                #endregion

                while (feature != null)
                {
                    #region 耕作制度分区参数检查
                    if (gzzdfqDt.Rows.Count == 1)
                    {
                        string gzzdfq = feature.get_Value(feature.Fields.FindField("EJQMC")).ToString().Trim();
                        if (!gzzdfqDt.Rows[0]["ProvinceSecondRegion"].ToString().Equals(gzzdfq))
                        {
                            DataRow newRow = referenceIndexChkResultDt.NewRow();
                            newRow[0] = xmc;
                            newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                            newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                            newRow[3] = "省二级区";
                            newRow[4] = "选择不正确";
                            referenceIndexChkResultDt.Rows.Add(newRow);
                        }
                    }
                    #endregion
                    #region 耕作制度参数检查
                    if (gzzdDt.Rows.Count == 1)
                    {
                        string gzzd = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                        if (!(gzzdDt.Rows[0]["gengzuozhidu1"].ToString().Equals(gzzd) || gzzdDt.Rows[0]["gengzuozhidu2"].ToString().Equals(gzzd)))
                        {
                            DataRow newRow = referenceIndexChkResultDt.NewRow();
                            newRow[0] = xmc;
                            newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                            newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                            newRow[3] = "耕作制度";
                            newRow[4] = "选择不正确";
                            referenceIndexChkResultDt.Rows.Add(newRow);
                        }
                    }
                    #endregion
                    #region 土地利用和经济系数标准参考字典表读取
                    string xz = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    DataTable tdlyjjxsDt = new DataTable();
                    string sqltdlyjjxs = "select * from zd_liyonghejingjidengzhiqu where xingzhengxiaqu = '" + xz + "'";
                    tdlyjjxsDt = m_dicAccessDB.getDataTable(sqltdlyjjxs);
                    if (tdlyjjxsDt.Rows.Count < 1)
                    {
                        DataRow newRow = referenceIndexChkResultDt.NewRow();
                        newRow[0] = xmc;
                        newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                        newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                        newRow[3] = "土地利用系数";
                        newRow[4] = "参考字典表中无此记录";
                        referenceIndexChkResultDt.Rows.Add(newRow);
                    }
                    string tdlyxs = feature.get_Value(feature.Fields.FindField("TDLYXS")).ToString().Trim();
                    string tdjjxs = feature.get_Value(feature.Fields.FindField("TDJJXS")).ToString().Trim();
                    #endregion
                    #region 光温潜力指数，产量比系数（早稻，冬甘薯),水田土地利用系数，水田土地经济系数参数检查
                    string dldm = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                    if (dldmArray.Contains(dldm))
                    {
                        if (gwqlDt.Rows.Count == 1)
                        {
                            string jzgwzs = feature.get_Value(feature.Fields.FindField("JZGWZS")).ToString().Trim();//晚稻
                            string zdzw1gw = feature.get_Value(feature.Fields.FindField("ZDZW1GW")).ToString().Trim();//早稻
                            string zdzw2gw = feature.get_Value(feature.Fields.FindField("ZDZW2GW")).ToString().Trim();//冬甘薯
                            if (!(gwqlDt.Rows[0]["wandao"].ToString().Equals(jzgwzs) && gwqlDt.Rows[0]["zaodao"].ToString().Contains(zdzw1gw) && gwqlDt.Rows[0]["dongganshu"].ToString().Equals(zdzw2gw)))
                            {
                                DataRow newRow = referenceIndexChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                                newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                                newRow[3] = "光温潜力指数";
                                newRow[4] = "选择不正确";
                                referenceIndexChkResultDt.Rows.Add(newRow);
                            }
                        }
                        if (clbxsDt.Rows.Count == 1)
                        {
                            string zdzw1b = feature.get_Value(feature.Fields.FindField("ZDZW1B")).ToString().Trim();//早稻
                            string zdzw2b = feature.get_Value(feature.Fields.FindField("ZDZW2B")).ToString().Trim();//冬甘薯
                            if (!(clbxsDt.Rows[0]["zaodao"].ToString().Equals(zdzw1b) && clbxsDt.Rows[0]["dongganshu"].ToString().Equals(zdzw2b)))
                            {
                                DataRow newRow = referenceIndexChkResultDt.NewRow();
                                newRow[0] = ejq;
                                newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                                newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                                newRow[3] = "产量比系数";
                                newRow[4] = "选择不正确";
                                referenceIndexChkResultDt.Rows.Add(newRow);
                            }
                        }
                        if (tdlyjjxsDt.Rows.Count == 1)
                        {
                            if (!tdlyxs.Contains(tdlyjjxsDt.Rows[0]["shuitianliyongdengzhiquxishu"].ToString()))
                            {
                                DataRow newRow = referenceIndexChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                                newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                                newRow[3] = "土地利用系数";
                                newRow[4] = "选择不正确";
                                referenceIndexChkResultDt.Rows.Add(newRow);
                            }
                            if (!tdjjxs.Contains(tdlyjjxsDt.Rows[0]["shuitianjingjidengzhiquxishu"].ToString()))
                            {
                                DataRow newRow = referenceIndexChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                                newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                                newRow[3] = "土地经济系数";
                                newRow[4] = "选择不正确";
                                referenceIndexChkResultDt.Rows.Add(newRow);
                            }
                        }
                    }
                    #endregion
                    #region 气候潜力指数，产量比系数（春花生，秋甘薯），旱地土地利用系数，旱地土地经济系数参数检查
                    if (!dldmArray.Contains(dldm))
                    {
                        if (qhqlDt.Rows.Count == 1)
                        {
                            string zdzw3qh = feature.get_Value(feature.Fields.FindField("ZDZW3QH")).ToString().Trim();//春花生
                            string zdzw4qh = feature.get_Value(feature.Fields.FindField("ZDZW4QH")).ToString().Trim();//秋甘薯
                            if (!(qhqlDt.Rows[0]["chunhuasheng"].ToString().Equals(zdzw3qh) && qhqlDt.Rows[0]["qiuganshu"].ToString().Equals(zdzw4qh)))
                            {
                                DataRow newRow = referenceIndexChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                                newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                                newRow[3] = "气候潜力指数";
                                newRow[4] = "选择不正确";
                                referenceIndexChkResultDt.Rows.Add(newRow);
                            }
                        }
                        if (clbxsDt.Rows.Count == 1)
                        {
                            string zdzw3b = feature.get_Value(feature.Fields.FindField("ZDZW3B")).ToString().Trim();//春花生
                            string zdzw4b = feature.get_Value(feature.Fields.FindField("ZDZW4B")).ToString().Trim();//秋甘薯
                            if (!(clbxsDt.Rows[0]["chunhuasheng"].ToString().Equals(zdzw3b) && clbxsDt.Rows[0]["qiuganshu"].ToString().Equals(zdzw4b)))
                            {
                                DataRow newRow = referenceIndexChkResultDt.NewRow();
                                newRow[0] = ejq;
                                newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                                newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                                newRow[3] = "产量比系数";
                                newRow[4] = "选择不正确";
                                referenceIndexChkResultDt.Rows.Add(newRow);
                            }
                        }
                        if (tdlyjjxsDt.Rows.Count == 1)
                        {
                            if (!tdlyxs.Contains(tdlyjjxsDt.Rows[0]["handiliyongdengzhiquxishu"].ToString()))
                            {
                                DataRow newRow = referenceIndexChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                                newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                                newRow[3] = "土地利用系数";
                                newRow[4] = "选择不正确";
                                referenceIndexChkResultDt.Rows.Add(newRow);
                            }
                            if (!tdjjxs.Contains(tdlyjjxsDt.Rows[0]["handijingjidegnzhiquxishu"].ToString()))
                            {
                                DataRow newRow = referenceIndexChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                                newRow[2] = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                                newRow[3] = "土地经济系数";
                                newRow[4] = "选择不正确";
                                referenceIndexChkResultDt.Rows.Add(newRow);
                            }
                        }
                    }
                    #endregion
                    feature = featureCursor.NextFeature();
                }
                return referenceIndexChkResultDt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }
        #endregion

        /// <summary>地类检查
        /// </summary>
        /// <param name="featureClass"></param>
        /// <returns></returns>
        public DataTable GetDLCheckResultDt(IFeatureClass featureClass)
        {
            List<DataTable> resultChkDtList = new List<DataTable>();
            try
            {
                #region 初始化地类检查结果表列
                DataTable dileiChkResultDt = new DataTable();
                DataColumn column = new DataColumn("县名称");
                dileiChkResultDt.Columns.Add(column);
                column = new DataColumn("乡镇");
                dileiChkResultDt.Columns.Add(column);
                column = new DataColumn("县级分等单元编号");
                dileiChkResultDt.Columns.Add(column);
                column = new DataColumn("耕作制度");
                dileiChkResultDt.Columns.Add(column);
                column = new DataColumn("参考地类");
                dileiChkResultDt.Columns.Add(column);
                column = new DataColumn("检查结果");
                dileiChkResultDt.Columns.Add(column);
                #endregion
                IQueryFilter queryFilter = new QueryFilter();
                IFeatureCursor featureCursor = featureClass.Search(null, true);
                IFeature feature = featureCursor.NextFeature();

                if (feature == null) return null;
                string[] dldmArray = { "114", "011", "012" }; //地类编码作为水田的地类代码数组

                #region 读取各参数标准的字典表，并对参考标准表进行检查判断
                string xmc = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();//获取数据库的县名称
                //耕作制度标准参考字典表
                DataTable gzzdDt = new DataTable();
                string sqlgzzd = "select * from zd_gengzuozhidu where QXNAME = '" + xmc + "'";
                gzzdDt = m_dicAccessDB.getDataTable(sqlgzzd);
                if (gzzdDt.Rows.Count < 1)
                {
                    DataRow newRow = dileiChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = "";
                    newRow[2] = "";
                    newRow[3] = "";
                    newRow[4] = "";
                    newRow[5] = "参考字典表中无此区县记录";
                    dileiChkResultDt.Rows.Add(newRow);
                }
                #endregion
                while (feature != null)
                {
                    string xz = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    string sjdybh = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    string dldm = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                    #region 耕作制度参数检查，地类检查（在耕作制度参数正确的基础上，由耕作制度确定地类然后与库中地类进行比较）
                    if (gzzdDt.Rows.Count == 1)
                    {
                        string gzzd = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                        gzzd = gzzd.Replace("-", "-"); //将“-”转为"-"; 
                        gzzd = gzzd.Replace(" -", "-"); //将“-”转为"-";
                        gzzd = gzzd.Replace("- ", "-"); //将“-”转为"-";
                        gzzd = gzzd.Replace(" - ", "-"); //将“-”转为"-";
                        if (!(gzzdDt.Rows[0]["gengzuozhidu1"].ToString().Equals(gzzd) || gzzdDt.Rows[0]["gengzuozhidu2"].ToString().Equals(gzzd)))
                        {
                            DataRow newRow = dileiChkResultDt.NewRow();
                            newRow[0] = xmc;
                            newRow[1] = "";
                            newRow[2] = "";
                            newRow[3] = "";
                            newRow[4] = "";
                            newRow[5] = "耕作制度选取不正确";
                            dileiChkResultDt.Rows.Add(newRow);
                        }

                        else if (gzzdDt.Rows[0]["gengzuozhidu1"].ToString().Equals(gzzd))//水田
                        {
                            if (!dldmArray.Contains(dldm))
                            {
                                DataRow newRow = dileiChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = xz;
                                newRow[2] = sjdybh;
                                newRow[3] = gzzd;
                                newRow[4] = "水田";
                                newRow[5] = "与参考地类不一致";
                                dileiChkResultDt.Rows.Add(newRow);
                            }
                        }
                        else if (gzzdDt.Rows[0]["gengzuozhidu2"].ToString().Equals(gzzd))//旱地
                        {
                            if (dldmArray.Contains(dldm))
                            {
                                DataRow newRow = dileiChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = xz;
                                newRow[2] = sjdybh;
                                newRow[3] = gzzd;
                                newRow[4] = "旱地";
                                newRow[5] = "与参考地类不一致";
                                dileiChkResultDt.Rows.Add(newRow);
                            }
                        }
                    }
                    #endregion
                    feature = featureCursor.NextFeature();
                }
                return dileiChkResultDt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }

        /// <summary>综合检查
        /// </summary>
        /// <param name="featureClass"></param>
        /// <returns></returns>
        public DataTable[] GetResultCheckDtArray(IFeatureClass featureClass)
        {
            DataTable[] resultChkDtArray = new DataTable[3];
            List<DataTable> resultChkDtList = new List<DataTable>();
            string exceptionInfo = "";
            try
            {
                #region 初始化参数检查结果表列
                DataTable referenceIndexChkResultDt = new DataTable();
                DataColumn column = new DataColumn("县名称");
                referenceIndexChkResultDt.Columns.Add(column);
                column = new DataColumn("乡镇");
                referenceIndexChkResultDt.Columns.Add(column);
                column = new DataColumn("县级分等单元编号");
                referenceIndexChkResultDt.Columns.Add(column);
                column = new DataColumn("参数名称");
                referenceIndexChkResultDt.Columns.Add(column);
                column = new DataColumn("检查结果");
                referenceIndexChkResultDt.Columns.Add(column);
                #endregion
                #region 初始化地类检查结果表列
                DataTable dileiChkResultDt = new DataTable();
                column = new DataColumn("县名称");
                dileiChkResultDt.Columns.Add(column);
                column = new DataColumn("乡镇");
                dileiChkResultDt.Columns.Add(column);
                column = new DataColumn("县级分等单元编号");
                dileiChkResultDt.Columns.Add(column);
                column = new DataColumn("耕作制度");
                dileiChkResultDt.Columns.Add(column);
                column = new DataColumn("参考地类");
                dileiChkResultDt.Columns.Add(column);
                column = new DataColumn("检查结果");
                dileiChkResultDt.Columns.Add(column);
                #endregion
                #region 初始化评价计算检查结果表列
                DataTable evolutionChkResultDt = new DataTable();
                column = new DataColumn("县名称");
                evolutionChkResultDt.Columns.Add(column);
                column = new DataColumn("乡镇");
                evolutionChkResultDt.Columns.Add(column);
                column = new DataColumn("县级分等单元编号");
                evolutionChkResultDt.Columns.Add(column);
                column = new DataColumn("计算的评价指数");
                evolutionChkResultDt.Columns.Add(column);
                column = new DataColumn("检查结果");
                evolutionChkResultDt.Columns.Add(column);
                #endregion
                IQueryFilter queryFilter = new QueryFilter();
                IFeatureCursor featureCursor = featureClass.Search(null, true);
                IFeature feature = featureCursor.NextFeature();

                if (feature == null) return null;
                string[] dldmArray = { "114K", "011", "012" }; //地类编码作为水田的地类代码数组

                //针对个别区县有中稻的情况（ZD5)

                #region 读取各参数标准的字典表，并对参考标准表进行检查判断
                string xmc = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();//获取数据库的县名称
                //耕作制度分区标准参考字典表
                DataTable gzzdfqDt = new DataTable();
                string sqlgzzdfq = "select * from zd_gengzuozhidufenqu where QXNAME = '" + xmc + "'";
                gzzdfqDt = m_dicAccessDB.getDataTable(sqlgzzdfq);
                if (gzzdfqDt.Rows.Count < 1)
                {
                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = "";
                    newRow[2] = "";
                    newRow[3] = "省二级区";
                    newRow[4] = "参考字典表中无此区县记录";
                    referenceIndexChkResultDt.Rows.Add(newRow);
                }
                //耕作制度标准参考字典表
                DataTable gzzdDt = new DataTable();
                string sqlgzzd = "select * from zd_gengzuozhidu where QXNAME = '" + xmc + "'";
                gzzdDt = m_dicAccessDB.getDataTable(sqlgzzd);
                DataSet ds = new DataSet();
                ds.Tables.Add(gzzdDt);
                if (gzzdDt.Rows.Count < 1)
                {
                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = "";
                    newRow[2] = "";
                    newRow[3] = "耕作制度";
                    newRow[4] = "参考字典表中无此区县记录";
                    referenceIndexChkResultDt.Rows.Add(newRow);
                }
                //光温潜力指数标准参考字典表
                DataTable gwqlDt = new DataTable();
                string sqlgwql = "select * from zd_guangwenqianli where QXNAME = '" + xmc + "'";
                gwqlDt = m_dicAccessDB.getDataTable(sqlgwql);
                if (gwqlDt.Rows.Count < 1)
                {
                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = "";
                    newRow[2] = "";
                    newRow[3] = "光温潜力指数";
                    newRow[4] = "参考字典表中无该区县记录";
                    referenceIndexChkResultDt.Rows.Add(newRow);
                }
                //气候潜力指数标准参考字典表
                DataTable qhqlDt = new DataTable();
                string sqlqhql = "select * from zd_qihouqianli where QXNAME = '" + xmc + "'";
                qhqlDt = m_dicAccessDB.getDataTable(sqlqhql);
                if (qhqlDt.Rows.Count < 1)
                {
                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = "";
                    newRow[2] = "";
                    newRow[3] = "气候潜力指数";
                    newRow[4] = "参考字典表中无此区县记录";
                    referenceIndexChkResultDt.Rows.Add(newRow);
                }
                //产量比系数标准参考字典表
                string sjq = feature.get_Value(feature.Fields.FindField("SJQMC")).ToString().Trim();
                DataTable clbxsDt = new DataTable();
                string sqlclbxs = "select * from zd_chanliangbixishu where erjiqu = '" + sjq + "'";
                clbxsDt = m_dicAccessDB.getDataTable(sqlclbxs);
                if (clbxsDt.Rows.Count < 1)
                {
                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = "";
                    newRow[2] = "";
                    newRow[3] = "产量比系数";
                    newRow[4] = "参考字典表中无此区县记录";
                    referenceIndexChkResultDt.Rows.Add(newRow);
                }
                //利用和经济系数
                DataTable lyhejjxsDT = new DataTable();
                string lyhejjxsSQL = "select * from zd_liyonghejingjixishu where erjiqu = '" + sjq + "'";
                lyhejjxsDT = m_dicAccessDB.getDataTable(lyhejjxsSQL);
                List<string> stlyxsList = new List<string>();
                List<string> stjjxsList = new List<string>();
                List<string> hdlyxsList = new List<string>();
                List<string> hdjjxsList = new List<string>();
                if (lyhejjxsDT.Rows.Count < 1)
                {
                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = "";
                    newRow[2] = "";
                    newRow[3] = "土地利用和经济系数";
                    newRow[4] = "参考字典表中无此区县记录";
                    referenceIndexChkResultDt.Rows.Add(newRow);
                }
                else
                {
                    for (int i = 0; i < lyhejjxsDT.Rows.Count; i++)
                    {
                        stlyxsList.Add(lyhejjxsDT.Rows[i]["shuitianliyongxishu"].ToString());
                        hdlyxsList.Add(lyhejjxsDT.Rows[i]["handiliyongxishu"].ToString());
                        stjjxsList.Add(lyhejjxsDT.Rows[i]["shuitianjingjixishu"].ToString());
                        hdjjxsList.Add(lyhejjxsDT.Rows[i]["handijingjixishu"].ToString());
                    }
                }
                #endregion

                #region 读取省级等别、国家等别划分表
                DataTable sjdbDt = new DataTable();
                string sjdbSQL = "select * from zd_shengjidengbie";
                sjdbDt = m_dicAccessDB.getDataTable(sjdbSQL);
                if (sjdbDt.Rows.Count < 1)
                {
                    DataRow newRow = evolutionChkResultDt.NewRow();
                    newRow["县名称"] = xmc;
                    newRow["乡镇"] = "";
                    newRow["县级分等单元编号"] = "";
                    newRow["计算的评价指数"] = "省级等别划分标准表";
                    newRow["检查结果"] = "未找到该表";
                    evolutionChkResultDt.Rows.Add(newRow);
                }
                DataTable gjdbDt = new DataTable();
                string gjdbSQL = "select * from zd_guojiadengbie";
                gjdbDt = m_dicAccessDB.getDataTable(gjdbSQL);
                if (gjdbDt.Rows.Count < 1)
                {
                    DataRow newRow = evolutionChkResultDt.NewRow();
                    newRow["县名称"] = xmc;
                    newRow["乡镇"] = "";
                    newRow["县级分等单元编号"] = "";
                    newRow["计算的评价指数"] = "国家级等别划分标准表";
                    newRow["检查结果"] = "未找到该表";
                    evolutionChkResultDt.Rows.Add(newRow);
                }

                #endregion
                int formatInt = 0;
                double formatDouble = 0.0;
                while (feature != null)
                {
                    xmc = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();//获取数据库的县名称
                    bool parameterChkOK = true;
                    string xz = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    string sjdybh = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    string dldm = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                    //string sstz = feature.get_Value(feature.Fields.FindField("SSTZ")).ToString().Trim();
                    string feature_SZ = feature.get_Value(feature.Fields.FindField("SZ")).ToString().Trim(); //获取熟制（SZ)//用于判断中稻的情况
                    exceptionInfo = "记录 '" + sjdybh + "'错误：";
                    #region 处理广州市的一些特殊情况
                    string[] unNormalRegionArray = { "天河区", "海珠区", "番禺区", "萝岗区", "花都区", "南沙区", "黄埔区", "荔湾区", "白云区", "东莞市", "南海区", "禅城区", "顺德区", "中山市", "光明新区", "坪山新区", "龙岗区", "福田区", "南山区", "宝安区", "盐田区", "罗湖区" };
                    if (unNormalRegionArray.Contains(xmc) && !xz.Equals("永和街道"))
                    {
                        dldm = "011";//全部做水田处理
                    }
                    #endregion

                    #region 耕作制度分区参数检查
                    if (gzzdfqDt.Rows.Count == 1)
                    {
                        if (!gzzdfqDt.Rows[0]["ProvinceSecondRegion"].ToString().Equals(sjq))
                        {
                            DataRow newRow = referenceIndexChkResultDt.NewRow();
                            newRow[0] = xmc;
                            newRow[1] = xz;
                            newRow[2] = sjdybh;
                            newRow[3] = "省二级区";
                            newRow[4] = "选择不正确";
                            referenceIndexChkResultDt.Rows.Add(newRow);
                            parameterChkOK = false;
                        }
                    }
                    #endregion
                    string tdlyxs = feature.get_Value(feature.Fields.FindField("TDLYXS")).ToString().Trim();
                    string tdjjxs = feature.get_Value(feature.Fields.FindField("TDJJXS")).ToString().Trim();

                    double zhzlf = 0.0;
                    double provinceZiranzhiliangDengzhishu = 0.0;
                    if (feature_SZ.Equals("一年一熟"))
                    {
                        #region 处理中稻的情况（不考虑地类，且某村中有中稻的情况，则该村所有耕地的耕作制度都为中稻）
                        string zd5gwzs = feature.get_Value(feature.Fields.FindField("ZDZW5GW")).ToString().Trim(); // 中稻
                        if (gwqlDt.Rows.Count == 1)
                        {
                            if (!(gwqlDt.Rows[0]["zhongdao"].ToString().Equals(zd5gwzs)))
                            {
                                DataRow newRow = referenceIndexChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = xz;
                                newRow[2] = sjdybh;
                                newRow[3] = "中稻光温潜力指数";
                                newRow[4] = "选择不正确";
                                referenceIndexChkResultDt.Rows.Add(newRow);
                                parameterChkOK = false;
                            }
                        }
                        else if (gwqlDt.Rows.Count == 2)
                        {
                            if (!((gwqlDt.Rows[0]["zhongdao"].ToString().Equals(zd5gwzs)) || (gwqlDt.Rows[1]["zhongdao"].ToString().Equals(zd5gwzs))))
                            {
                                DataRow newRow = referenceIndexChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = xz;
                                newRow[2] = sjdybh;
                                newRow[3] = "中稻光温潜力指数";
                                newRow[4] = "选择不正确";
                                referenceIndexChkResultDt.Rows.Add(newRow);
                                parameterChkOK = false;
                            }
                        }
                        string zdzw5b = feature.get_Value(feature.Fields.FindField("ZDZW5B")).ToString().Trim(); // 中稻
                        if (!(clbxsDt.Rows[0]["zhongdao"].ToString().Equals(zdzw5b)))
                        {
                            DataRow newRow = referenceIndexChkResultDt.NewRow();
                            newRow[0] = xmc;
                            newRow[1] = xz;
                            newRow[2] = sjdybh;
                            newRow[3] = "中稻产量比系数";
                            newRow[4] = "选择不正确";
                            referenceIndexChkResultDt.Rows.Add(newRow);
                            parameterChkOK = false;
                        }
                        #region "中稻类型"下的综合自然质量分
                        double zd5_zrzlf = 0.0;
                        if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZDZW5F")).ToString(), out formatDouble))
                        {
                            DataRow newRow = evolutionChkResultDt.NewRow();
                            newRow["县名称"] = xmc;
                            newRow["乡镇"] = xz;
                            newRow["县级分等单元编号"] = sjdybh;
                            newRow["计算的评价指数"] = "中稻自然质量分";
                            newRow["检查结果"] = "ZDZW5F值格式不正确";
                            evolutionChkResultDt.Rows.Add(newRow);
                            feature = featureCursor.NextFeature();
                            continue;
                        }
                        zd5_zrzlf = double.Parse(feature.get_Value(feature.Fields.FindField("ZDZW5F")).ToString());
                        double zd_zhzlf = zd5_zrzlf;
                        if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZHZLF")).ToString(), out formatDouble))
                        {
                            DataRow newRow = evolutionChkResultDt.NewRow();
                            newRow["县名称"] = xmc;
                            newRow["乡镇"] = xz;
                            newRow["县级分等单元编号"] = sjdybh;
                            newRow["计算的评价指数"] = "综合自然质量分";
                            newRow["检查结果"] = "ZHZLF值格式不正确";
                            evolutionChkResultDt.Rows.Add(newRow);
                            feature = featureCursor.NextFeature();
                            continue;
                        }
                        if (!(Math.Abs((zd_zhzlf - double.Parse(feature.get_Value(feature.Fields.FindField("ZHZLF")).ToString()))) <= 1))
                        {
                            DataRow newRow = evolutionChkResultDt.NewRow();
                            newRow["县名称"] = xmc;
                            newRow["乡镇"] = xz;
                            newRow["县级分等单元编号"] = sjdybh;
                            newRow["计算的评价指数"] = "综合自然质量分";
                            newRow["检查结果"] = "计算值错误";
                            evolutionChkResultDt.Rows.Add(newRow);
                        }
                        #endregion
                        #region "中稻类型"下的省级自然等指数,公式：中稻自然等指数/1
                        double zd5_zrdzs = 0.0;
                        //中稻自然等指数
                        if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZD5ZRDZS")).ToString(), out formatDouble))
                        {
                            DataRow newRow = evolutionChkResultDt.NewRow();
                            newRow["县名称"] = xmc;
                            newRow["乡镇"] = xz;
                            newRow["县级分等单元编号"] = sjdybh;
                            newRow["计算的评价指数"] = "中稻自然质量等指数";
                            newRow["检查结果"] = "ZD5ZRDZS值格式不正确";
                            evolutionChkResultDt.Rows.Add(newRow);
                            feature = featureCursor.NextFeature();
                            continue;
                        }
                        zd5_zrdzs = double.Parse(feature.get_Value(feature.Fields.FindField("ZD5ZRDZS")).ToString());
                        provinceZiranzhiliangDengzhishu = zd5_zrdzs;
                        if (!(Math.Abs((provinceZiranzhiliangDengzhishu - double.Parse(feature.get_Value(feature.Fields.FindField("ZRDZS")).ToString()))) <= 1.5))
                        {
                            DataRow newRow = evolutionChkResultDt.NewRow();
                            newRow["县名称"] = xmc;
                            newRow["乡镇"] = xz;
                            newRow["县级分等单元编号"] = sjdybh;
                            newRow["计算的评价指数"] = "省级自然质量等指数";
                            newRow["检查结果"] = "计算值错误";
                            evolutionChkResultDt.Rows.Add(newRow);
                            feature = featureCursor.NextFeature();
                            continue;
                        }
                        #endregion
                        //
                        #endregion
                    }
                    else
                    {
                        #region 耕作制度参数检查，地类检查（在耕作制度参数正确的基础上，由耕作制度确定地类然后与库中地类进行比较）
                        string gzzd = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                        if (gzzdDt.Rows.Count == 1)
                        {
                            #region 字符处理
                            gzzd = gzzd.Replace("－", "-");
                            gzzd = gzzd.Replace(" －", "-");
                            gzzd = gzzd.Replace("－ ", "-");
                            gzzd = gzzd.Replace(" － ", "-");
                            gzzd = gzzd.Replace("—", "-"); //将“-”转为"-"; 
                            gzzd = gzzd.Replace(" -", "-"); //将“-”转为"-";
                            gzzd = gzzd.Replace("- ", "-"); //将“-”转为"-";
                            gzzd = gzzd.Replace(" - ", "-"); //将“-”转为"-";
                            gzzd = gzzd.Replace(" — ", "-"); //将“-”转为"-";
                            gzzd = gzzd.Replace("— ", "-"); //将“-”转为"-";
                            gzzd = gzzd.Replace(" —", "-"); //将“-”转为"-";
                            #endregion
                            if (!(gzzdDt.Rows[0]["gengzuozhidu1"].ToString().Equals(gzzd) || gzzdDt.Rows[0]["gengzuozhidu2"].ToString().Equals(gzzd)))
                            {
                                DataRow newRow = referenceIndexChkResultDt.NewRow();
                                newRow[0] = xmc;
                                newRow[1] = xz;
                                newRow[2] = sjdybh;
                                newRow[3] = "耕作制度";
                                newRow[4] = "选择不正确";
                                referenceIndexChkResultDt.Rows.Add(newRow);
                                parameterChkOK = false;
                            }

                            else if (gzzdDt.Rows[0]["gengzuozhidu1"].ToString().Equals(gzzd))//水田
                            {
                                if (!dldmArray.Contains(dldm))
                                {
                                    DataRow newRow = dileiChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = gzzd;
                                    newRow[4] = "水田";
                                    newRow[5] = "与参考地类不一致";
                                    dileiChkResultDt.Rows.Add(newRow);
                                    parameterChkOK = false;
                                }
                                //if (sstz.EndsWith("壤"))
                                //{
                                //    DataRow newRow = dileiChkResultDt.NewRow();
                                //    newRow[0] = xmc;
                                //    newRow[1] = xz;
                                //    newRow[2] = sjdybh;
                                //    newRow[3] = gzzd;
                                //    newRow[4] = "水田";
                                //    newRow[5] = "含有自然土种";
                                //    dileiChkResultDt.Rows.Add(newRow);
                                //    //parameterChkOK = false;
                                //}

                            }
                            else if (gzzdDt.Rows[0]["gengzuozhidu2"].ToString().Equals(gzzd))//旱地
                            {
                                if (dldmArray.Contains(dldm))
                                {
                                    DataRow newRow = dileiChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = gzzd;
                                    newRow[4] = "旱地";
                                    newRow[5] = "与参考地类不一致";
                                    dileiChkResultDt.Rows.Add(newRow);
                                    parameterChkOK = false;
                                }
                            }
                        }
                        #endregion
                        #region 光温潜力指数，产量比系数（早稻，冬甘薯),水田土地利用系数，水田土地经济系数参数检查
                        if (dldmArray.Contains(dldm))
                        {
                            if (gwqlDt.Rows.Count == 1)
                            {
                                if (!gzzd.Contains("薯"))
                                {
                                    string jzgwzs = feature.get_Value(feature.Fields.FindField("JZGWZS")).ToString().Trim();//晚稻
                                    string zdzw1gw = feature.get_Value(feature.Fields.FindField("ZDZW1GW")).ToString().Trim();//早稻
                                    if (!(gwqlDt.Rows[0]["wandao"].ToString().Equals(jzgwzs) && gwqlDt.Rows[0]["zaodao"].ToString().Equals(zdzw1gw)))
                                    {
                                        DataRow newRow = referenceIndexChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = "光温潜力指数";
                                        newRow[4] = "选择不正确";
                                        referenceIndexChkResultDt.Rows.Add(newRow);
                                        parameterChkOK = false;
                                    }
                                }
                                else
                                {
                                    string jzgwzs = feature.get_Value(feature.Fields.FindField("JZGWZS")).ToString().Trim();//晚稻
                                    string zdzw1gw = feature.get_Value(feature.Fields.FindField("ZDZW1GW")).ToString().Trim();//早稻
                                    string zdzw2gw = feature.get_Value(feature.Fields.FindField("ZDZW2GW")).ToString().Trim();//冬甘薯
                                    if (!(gwqlDt.Rows[0]["wandao"].ToString().Equals(jzgwzs) && gwqlDt.Rows[0]["zaodao"].ToString().Contains(zdzw1gw) && gwqlDt.Rows[0]["dongganshu"].ToString().Equals(zdzw2gw)))
                                    {
                                        DataRow newRow = referenceIndexChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = "光温潜力指数";
                                        newRow[4] = "选择不正确";
                                        referenceIndexChkResultDt.Rows.Add(newRow);
                                        parameterChkOK = false;
                                    }
                                }
                            }
                            else if (gwqlDt.Rows.Count == 2)
                            {
                                if (!gzzd.Contains("薯"))
                                {
                                    string jzgwzs = feature.get_Value(feature.Fields.FindField("JZGWZS")).ToString().Trim();//晚稻
                                    string zdzw1gw = feature.get_Value(feature.Fields.FindField("ZDZW1GW")).ToString().Trim();//早稻
                                    if (!((gwqlDt.Rows[0]["wandao"].ToString().Equals(jzgwzs) && gwqlDt.Rows[0]["zaodao"].ToString().Equals(zdzw1gw)) || (gwqlDt.Rows[1]["wandao"].ToString().Equals(jzgwzs) && gwqlDt.Rows[1]["zaodao"].ToString().Equals(zdzw1gw))))
                                    {
                                        DataRow newRow = referenceIndexChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = "光温潜力指数";
                                        newRow[4] = "选择不正确";
                                        referenceIndexChkResultDt.Rows.Add(newRow);
                                        parameterChkOK = false;
                                    }
                                }
                                else
                                {
                                    string jzgwzs = feature.get_Value(feature.Fields.FindField("JZGWZS")).ToString().Trim();//晚稻
                                    string zdzw1gw = feature.get_Value(feature.Fields.FindField("ZDZW1GW")).ToString().Trim();//早稻
                                    string zdzw2gw = feature.get_Value(feature.Fields.FindField("ZDZW2GW")).ToString().Trim();//冬甘薯
                                    if (!((gwqlDt.Rows[0]["wandao"].ToString().Equals(jzgwzs) && gwqlDt.Rows[0]["zaodao"].ToString().Contains(zdzw1gw) && gwqlDt.Rows[0]["dongganshu"].ToString().Equals(zdzw2gw)) ||(gwqlDt.Rows[1]["wandao"].ToString().Equals(jzgwzs) && gwqlDt.Rows[1]["zaodao"].ToString().Contains(zdzw1gw) && gwqlDt.Rows[1]["dongganshu"].ToString().Equals(zdzw2gw))))
                                    {
                                        DataRow newRow = referenceIndexChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = "光温潜力指数";
                                        newRow[4] = "选择不正确";
                                        referenceIndexChkResultDt.Rows.Add(newRow);
                                        parameterChkOK = false;
                                    }
                                }
                            }
                            if (clbxsDt.Rows.Count == 1)
                            {
                                if (!gzzd.Contains("薯"))
                                {
                                    string zdzw1b = feature.get_Value(feature.Fields.FindField("ZDZW1B")).ToString().Trim();//早稻
                                    if (!(clbxsDt.Rows[0]["zaodao"].ToString().Equals(zdzw1b)))
                                    {
                                        DataRow newRow = referenceIndexChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = "产量比系数";
                                        newRow[4] = "选择不正确";
                                        referenceIndexChkResultDt.Rows.Add(newRow);
                                        parameterChkOK = false;
                                    }
                                }
                                else
                                {
                                    string zdzw1b = feature.get_Value(feature.Fields.FindField("ZDZW1B")).ToString().Trim();//早稻
                                    string zdzw2b = feature.get_Value(feature.Fields.FindField("ZDZW2B")).ToString().Trim();//冬甘薯
                                    if (!(clbxsDt.Rows[0]["zaodao"].ToString().Equals(zdzw1b) && clbxsDt.Rows[0]["dongganshu"].ToString().Equals(zdzw2b)))
                                    {
                                        DataRow newRow = referenceIndexChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = "产量比系数";
                                        newRow[4] = "选择不正确";
                                        referenceIndexChkResultDt.Rows.Add(newRow);
                                        parameterChkOK = false;
                                    }
                                }
                            }
                            if (stlyxsList.Count > 0 && stjjxsList.Count > 0)
                            {
                                if (!stlyxsList.Contains(tdlyxs))
                                {
                                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = "土地利用系数";
                                    newRow[4] = "选择不正确";
                                    referenceIndexChkResultDt.Rows.Add(newRow);
                                    parameterChkOK = false;
                                }
                                if (!stjjxsList.Contains(tdjjxs))
                                {
                                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = "土地经济系数";
                                    newRow[4] = "选择不正确";
                                    referenceIndexChkResultDt.Rows.Add(newRow);
                                    parameterChkOK = false;
                                }
                            }
                        }
                    #endregion
                        #region 气候潜力指数，产量比系数（春花生，秋甘薯），旱地土地利用系数，旱地土地经济系数参数检查
                        if (!dldmArray.Contains(dldm))//旱地
                        {
                            if (qhqlDt.Rows.Count == 1)
                            {
                                string zdzw3qh = feature.get_Value(feature.Fields.FindField("ZDZW3QH")).ToString().Trim();//春花生
                                string zdzw4qh = feature.get_Value(feature.Fields.FindField("ZDZW4QH")).ToString().Trim();//秋甘薯
                                if (!(qhqlDt.Rows[0]["chunhuasheng"].ToString().Equals(zdzw3qh) && qhqlDt.Rows[0]["qiuganshu"].ToString().Equals(zdzw4qh)))
                                {
                                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = "气候潜力指数";
                                    newRow[4] = "选择不正确";
                                    referenceIndexChkResultDt.Rows.Add(newRow);
                                    parameterChkOK = false;
                                }
                            }
                            else if (qhqlDt.Rows.Count == 2)
                            {
                                string zdzw3qh = feature.get_Value(feature.Fields.FindField("ZDZW3QH")).ToString().Trim();//春花生
                                string zdzw4qh = feature.get_Value(feature.Fields.FindField("ZDZW4QH")).ToString().Trim();//秋甘薯
                                if (!((qhqlDt.Rows[0]["chunhuasheng"].ToString().Equals(zdzw3qh) && qhqlDt.Rows[0]["qiuganshu"].ToString().Equals(zdzw4qh))||(qhqlDt.Rows[1]["chunhuasheng"].ToString().Equals(zdzw3qh) && qhqlDt.Rows[1]["qiuganshu"].ToString().Equals(zdzw4qh))))
                                {
                                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = "气候潜力指数";
                                    newRow[4] = "选择不正确";
                                    referenceIndexChkResultDt.Rows.Add(newRow);
                                    parameterChkOK = false;
                                }
                            }
                            if (clbxsDt.Rows.Count == 1)
                            {
                                string zdzw3b = feature.get_Value(feature.Fields.FindField("ZDZW3B")).ToString().Trim();//春花生
                                string zdzw4b = feature.get_Value(feature.Fields.FindField("ZDZW4B")).ToString().Trim();//秋甘薯
                                if (!(clbxsDt.Rows[0]["chunhuasheng"].ToString().Equals(zdzw3b) && clbxsDt.Rows[0]["qiuganshu"].ToString().Equals(zdzw4b)))
                                {
                                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = "产量比系数";
                                    newRow[4] = "选择不正确";
                                    referenceIndexChkResultDt.Rows.Add(newRow);
                                    parameterChkOK = false;
                                }
                            }
                            if (hdlyxsList.Count > 0 && hdjjxsList.Count > 0)
                            {
                                if (!hdlyxsList.Contains(tdlyxs))
                                {
                                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = "土地利用系数";
                                    newRow[4] = "选择不正确";
                                    referenceIndexChkResultDt.Rows.Add(newRow);
                                    parameterChkOK = false;
                                }
                                if (!hdjjxsList.Contains(tdjjxs))
                                {
                                    DataRow newRow = referenceIndexChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = "土地经济系数";
                                    newRow[4] = "选择不正确";
                                    referenceIndexChkResultDt.Rows.Add(newRow);
                                    parameterChkOK = false;
                                }
                            }
                        }
                        #endregion
                        if (!parameterChkOK)
                        {
                            DataRow newRow = evolutionChkResultDt.NewRow();
                            newRow[0] = xmc;
                            newRow[1] = xz;
                            newRow[2] = sjdybh;
                            newRow[3] = "全部指数及等别";
                            newRow[4] = "未检查：前提参数选择不正确，请先检查参数";
                            evolutionChkResultDt.Rows.Add(newRow);
                            feature = featureCursor.NextFeature();
                            continue;
                        }
                        #region 综合自然质量分（公式："几何平均法"改为"算术平均"）、省级自然等指数
                        if (!dldmArray.Contains(dldm))//旱地
                        {
                            #region "旱地类型"下的综合自然质量分
                            double zd3_zrzlf = 0.0;
                            double zd4_zrzlf = 0.0;
                            if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZDZW3F")).ToString(), out formatDouble))
                            {
                                DataRow newRow = evolutionChkResultDt.NewRow();
                                newRow["县名称"] = xmc;
                                newRow["乡镇"] = xz;
                                newRow["县级分等单元编号"] = sjdybh;
                                newRow["计算的评价指数"] = "春花生自然质量分";
                                newRow["检查结果"] = "ZDZW3F值格式不正确";
                                evolutionChkResultDt.Rows.Add(newRow);
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            zd3_zrzlf = double.Parse(feature.get_Value(feature.Fields.FindField("ZDZW3F")).ToString());
                            if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZDZW4F")).ToString(), out formatDouble))
                            {
                                DataRow newRow = evolutionChkResultDt.NewRow();
                                newRow["县名称"] = xmc;
                                newRow["乡镇"] = xz;
                                newRow["县级分等单元编号"] = sjdybh;
                                newRow["计算的评价指数"] = "秋甘薯自然质量分";
                                newRow["检查结果"] = "ZDZW4F值格式不正确";
                                evolutionChkResultDt.Rows.Add(newRow);
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            zd4_zrzlf = double.Parse(feature.get_Value(feature.Fields.FindField("ZDZW4F")).ToString());
                            //zhzlf = Math.Pow((zd3_zrzlf * zd4_zrzlf), 1 / 2);//几何平均数
                            zhzlf = (zd3_zrzlf + zd4_zrzlf) / 2;//算术平均数
                            if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZHZLF")).ToString(), out formatDouble))
                            {
                                DataRow newRow = evolutionChkResultDt.NewRow();
                                newRow["县名称"] = xmc;
                                newRow["乡镇"] = xz;
                                newRow["县级分等单元编号"] = sjdybh;
                                newRow["计算的评价指数"] = "综合自然质量分";
                                newRow["检查结果"] = "ZHZLF值格式不正确";
                                evolutionChkResultDt.Rows.Add(newRow);
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            if (!(Math.Abs((zhzlf - double.Parse(feature.get_Value(feature.Fields.FindField("ZHZLF")).ToString()))) <= 1))
                            {
                                DataRow newRow = evolutionChkResultDt.NewRow();
                                newRow["县名称"] = xmc;
                                newRow["乡镇"] = xz;
                                newRow["县级分等单元编号"] = sjdybh;
                                newRow["计算的评价指数"] = "综合自然质量分";
                                newRow["检查结果"] = "计算值错误";
                                evolutionChkResultDt.Rows.Add(newRow);
                            }
                            #endregion
                            #region "旱地类型"下的省级自然等指数，公式：春花生自然等指数+秋甘薯自然等指数
                            double zd3zrdzs = 0.0;
                            double zd4zrdzs = 0.0;
                            //春花生自然等指数
                            if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZD3ZRDZS")).ToString(), out formatDouble))
                            {
                                DataRow newRow = evolutionChkResultDt.NewRow();
                                newRow["县名称"] = xmc;
                                newRow["乡镇"] = xz;
                                newRow["县级分等单元编号"] = sjdybh;
                                newRow["计算的评价指数"] = "春花生自然等指数";
                                newRow["检查结果"] = "ZD3ZRDZS值格式不正确";
                                evolutionChkResultDt.Rows.Add(newRow);
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            zd3zrdzs = double.Parse(feature.get_Value(feature.Fields.FindField("ZD3ZRDZS")).ToString());
                            //秋甘薯自然等指数
                            if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZD4ZRDZS")).ToString(), out formatDouble))
                            {
                                DataRow newRow = evolutionChkResultDt.NewRow();
                                newRow["县名称"] = xmc;
                                newRow["乡镇"] = xz;
                                newRow["县级分等单元编号"] = sjdybh;
                                newRow["计算的评价指数"] = "秋甘薯自然等指数";
                                newRow["检查结果"] = "ZD4ZRDZS值格式不正确";
                                evolutionChkResultDt.Rows.Add(newRow);
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            zd4zrdzs = double.Parse(feature.get_Value(feature.Fields.FindField("ZD4ZRDZS")).ToString());
                            provinceZiranzhiliangDengzhishu = zd3zrdzs + zd4zrdzs;
                            if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZRDZS")).ToString(), out formatDouble))
                            {
                                DataRow newRow = evolutionChkResultDt.NewRow();
                                newRow["县名称"] = xmc;
                                newRow["乡镇"] = xz;
                                newRow["县级分等单元编号"] = sjdybh;
                                newRow["计算的评价指数"] = "省级自然质量等指数";
                                newRow["检查结果"] = "ZRDZS值格式不正确";
                                evolutionChkResultDt.Rows.Add(newRow);
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            if (!(Math.Abs((provinceZiranzhiliangDengzhishu - double.Parse(feature.get_Value(feature.Fields.FindField("ZRDZS")).ToString()))) <= 1))
                            {
                                DataRow newRow = evolutionChkResultDt.NewRow();
                                newRow["县名称"] = xmc;
                                newRow["乡镇"] = xz;
                                newRow["县级分等单元编号"] = sjdybh;
                                newRow["计算的评价指数"] = "省级自然质量等指数";
                                newRow["检查结果"] = "计算值错误";
                                evolutionChkResultDt.Rows.Add(newRow);
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            provinceZiranzhiliangDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("ZRDZS")).ToString());
                            #endregion
                        }
                        if (dldmArray.Contains(dldm))//水田
                        {
                            if (feature_SZ.Equals("一年一熟")) // 中稻
                            {
                            }
                            else
                            {

                                if (!gzzd.Contains("薯"))
                                {
                                    #region "水田类型"下的综合自然质量分
                                    double jz_zrzlf = 0.0;
                                    double zd1_zrzlf = 0.0;
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("JZZWF")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "晚稻自然质量分";
                                        newRow["检查结果"] = "JZZWF值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    jz_zrzlf = double.Parse(feature.get_Value(feature.Fields.FindField("JZZWF")).ToString());
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZDZW1F")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "早稻自然质量分";
                                        newRow["检查结果"] = "ZDZW1F值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    zd1_zrzlf = double.Parse(feature.get_Value(feature.Fields.FindField("ZDZW1F")).ToString());
                                    //zhzlf = Math.Pow((jz_zrzlf * zd1_zrzlf), 1 / 2);//几何平均数
                                    zhzlf = (jz_zrzlf + zd1_zrzlf) / 2;//算术平均数
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZHZLF")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "综合自然质量分";
                                        newRow["检查结果"] = "ZHZLF值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    if (!(Math.Abs((zhzlf - double.Parse(feature.get_Value(feature.Fields.FindField("ZHZLF")).ToString()))) <= 1))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "综合自然质量分";
                                        newRow["检查结果"] = "计算值错误";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                    }
                                    #endregion
                                    #region "水田类型"下的省级自然等指数,公式：(晚稻自然等指数*2+早稻自然等指数*2)/2
                                    double jzzrdzs = 0.0;
                                    double zd1zrdzs = 0.0;
                                    //晚稻自然等指数
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("JZZRDZS")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "晚稻自然质量等指数";
                                        newRow["检查结果"] = "JZZRDZS值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    jzzrdzs = double.Parse(feature.get_Value(feature.Fields.FindField("JZZRDZS")).ToString());
                                    //早稻自然等指数
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZD1ZRDZS")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "早稻自然质量等指数";
                                        newRow["检查结果"] = "ZD1ZRDZS值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    zd1zrdzs = double.Parse(feature.get_Value(feature.Fields.FindField("ZD1ZRDZS")).ToString());
                                    provinceZiranzhiliangDengzhishu = jzzrdzs + zd1zrdzs;
                                    if (!(Math.Abs((provinceZiranzhiliangDengzhishu - double.Parse(feature.get_Value(feature.Fields.FindField("ZRDZS")).ToString()))) <= 1.5))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "省级自然质量等指数";
                                        newRow["检查结果"] = "计算值错误";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    #endregion
                                }
                                else
                                {
                                    #region "水田类型"下的综合自然质量分
                                    double jz_zrzlf = 0.0;
                                    double zd1_zrzlf = 0.0;
                                    double zd2_zrzlf = 0.0;
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("JZZWF")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "晚稻自然质量分";
                                        newRow["检查结果"] = "JZZWF值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    jz_zrzlf = double.Parse(feature.get_Value(feature.Fields.FindField("JZZWF")).ToString());
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZDZW1F")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "早稻自然质量分";
                                        newRow["检查结果"] = "ZDZW1F值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    zd1_zrzlf = double.Parse(feature.get_Value(feature.Fields.FindField("ZDZW1F")).ToString());
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZDZW2F")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "冬甘薯自然质量分";
                                        newRow["检查结果"] = "ZDZW2F值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    zd2_zrzlf = double.Parse(feature.get_Value(feature.Fields.FindField("ZDZW2F")).ToString());
                                    //zhzlf = Math.Pow((jz_zrzlf * zd1_zrzlf * zd2_zrzlf), 1 / 3);//几何平均数
                                    zhzlf = (jz_zrzlf + zd1_zrzlf + zd2_zrzlf) / 3;//算术平均数
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZHZLF")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "综合自然质量分";
                                        newRow["检查结果"] = "ZHZLF值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    if (!(Math.Abs((zhzlf - double.Parse(feature.get_Value(feature.Fields.FindField("ZHZLF")).ToString()))) <= 1))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "综合自然质量分";
                                        newRow["检查结果"] = "计算值错误";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                    }
                                    #endregion
                                    #region "水田类型"下的省级自然等指数,公式：(晚稻自然等指数*2+早稻自然等指数*2+冬甘薯自然等指数)/2
                                    double jzzrdzs = 0.0;
                                    double zd1zrdzs = 0.0;
                                    double zd2zrdzs = 0.0;
                                    //晚稻自然等指数
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("JZZRDZS")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "晚稻自然质量等指数";
                                        newRow["检查结果"] = "JZZRDZS值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    jzzrdzs = double.Parse(feature.get_Value(feature.Fields.FindField("JZZRDZS")).ToString());
                                    //早稻自然等指数
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZD1ZRDZS")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "早稻自然质量等指数";
                                        newRow["检查结果"] = "ZD1ZRDZS值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    zd1zrdzs = double.Parse(feature.get_Value(feature.Fields.FindField("ZD1ZRDZS")).ToString());
                                    //冬甘薯自然等指数
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZD2ZRDZS")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "冬甘薯自然质量等指数";
                                        newRow["检查结果"] = "ZD2ZRDZS值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    zd2zrdzs = double.Parse(feature.get_Value(feature.Fields.FindField("ZD2ZRDZS")).ToString());
                                    provinceZiranzhiliangDengzhishu = jzzrdzs + zd1zrdzs + (zd2zrdzs / 2);
                                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("ZRDZS")).ToString(), out formatDouble))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "省级自然质量等指数";
                                        newRow["检查结果"] = "ZRDZS值格式不正确";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    if (!(Math.Abs((provinceZiranzhiliangDengzhishu - double.Parse(feature.get_Value(feature.Fields.FindField("ZRDZS")).ToString()))) <= 1.5))
                                    {
                                        DataRow newRow = evolutionChkResultDt.NewRow();
                                        newRow["县名称"] = xmc;
                                        newRow["乡镇"] = xz;
                                        newRow["县级分等单元编号"] = sjdybh;
                                        newRow["计算的评价指数"] = "省级自然质量等指数";
                                        newRow["检查结果"] = "计算值错误";
                                        evolutionChkResultDt.Rows.Add(newRow);
                                        feature = featureCursor.NextFeature();
                                        continue;
                                    }
                                    #endregion
                                }
                                provinceZiranzhiliangDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("ZRDZS")).ToString());
                            }
                        }
                        #endregion
                    }
                    #region 省级利用等指数、经济等指数
                    double liyongXishu = 0.0;
                    double jingjiXishu = 0.0;
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("TDLYXS")).ToString(), out formatDouble))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "土地利用系数";
                        newRow["检查结果"] = "TDLYXS值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    liyongXishu = double.Parse(feature.get_Value(feature.Fields.FindField("TDLYXS")).ToString());
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("TDJJXS")).ToString(), out formatDouble))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "土地经济系数";
                        newRow["检查结果"] = "TDJJXS值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    jingjiXishu = double.Parse(feature.get_Value(feature.Fields.FindField("TDJJXS")).ToString());
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("LYDZS")).ToString(), out formatDouble))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "省级利用等指数";
                        newRow["检查结果"] = "LYDZS值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    //省级利用等指数=土地利用系数*省级自然等指数
                    double provinceLiyongDengzhishu = provinceZiranzhiliangDengzhishu * liyongXishu;
                    if (!(Math.Abs((provinceLiyongDengzhishu - double.Parse(feature.get_Value(feature.Fields.FindField("LYDZS")).ToString()))) <= 1))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "省级利用等指数";
                        newRow["检查结果"] = "计算值错误";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    //省级经济等指数=土地经济系数*省级利用等指数
                    provinceLiyongDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("LYDZS")).ToString());
                    double provinceJingjiDengzhishu = provinceLiyongDengzhishu * jingjiXishu;
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("DBZ")).ToString(), out formatDouble))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "省级等别指数";
                        newRow["检查结果"] = "DBZ值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    if (!(Math.Abs((provinceJingjiDengzhishu - double.Parse(feature.get_Value(feature.Fields.FindField("DBZ")).ToString()))) <= 1))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "省级等别指数";
                        newRow["检查结果"] = "计算值错误";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    provinceJingjiDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("DBZ")).ToString());
                    #endregion
                    #region 国家自然质量等指数、利用等指数、经济等指数(以东部区广州省为例）
                    //国家级自然质量等指数＝广东省自然质量等指数*1.6153+245.28
                    double countyZiranzhiliangDengzhishu = provinceZiranzhiliangDengzhishu * 1.6153 + 245.28; //国家级自然质量等指数
                    //国家级利用等指数＝广东省利用等指数*0.8675+532.07
                    double countyLiyongDengzhishu = provinceLiyongDengzhishu * 0.8675 + 532.07;  //国家级利用等指数
                    //国家级经济等指数＝广东省经济等指数*1.0500+780.03
                    double countyJingjiDengzhishu = provinceJingjiDengzhishu * 1.0500 + 780.03;//国家级经济等指数
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("GJZRDZS")).ToString(), out formatDouble))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "国家级自然质量等指数";
                        newRow["检查结果"] = "GJZRDZS值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    if (!(Math.Abs((countyZiranzhiliangDengzhishu - double.Parse(feature.get_Value(feature.Fields.FindField("GJZRDZS")).ToString()))) <= 1.6153))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "国家级自然质量等指数";
                        newRow["检查结果"] = "计算值错误";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    countyZiranzhiliangDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("GJZRDZS")).ToString());
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("GJLYDZS")).ToString(), out formatDouble))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "国家级利用等指数";
                        newRow["检查结果"] = "GJLYDZS值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    if (!(Math.Abs((countyLiyongDengzhishu - double.Parse(feature.get_Value(feature.Fields.FindField("GJLYDZS")).ToString()))) <= 1))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "国家级利用等指数";
                        newRow["检查结果"] = "计算值错误";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    countyLiyongDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("GJLYDZS")).ToString());
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField("GJDBZS")).ToString(), out formatDouble))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "国家级等别指数";
                        newRow["检查结果"] = "GJDBZS值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    if (!(Math.Abs((countyJingjiDengzhishu - double.Parse(feature.get_Value(feature.Fields.FindField("GJDBZS")).ToString()))) <= 1.05))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "国家级等别指数";
                        newRow["检查结果"] = "计算值错误";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    countyJingjiDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("GJDBZS")).ToString());
                    #endregion
                    #region 省级自然质量等别、利用等别、经济等别（查询省级等别表）
                    int provinceZiranzhiliangDengbie = 0;   //省级自然质量等别
                    int provinceLiyongDengbie = 0;          //省级利用等别
                    int provinceJingjiDengbie = 0;          //省级经济等别
                    if (!int.TryParse(feature.get_Value(feature.Fields.FindField("ZRDB")).ToString(), out formatInt))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "省级自然质量等别";
                        newRow["检查结果"] = "ZRDB值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    if (!int.TryParse(feature.get_Value(feature.Fields.FindField("LYD")).ToString(), out formatInt))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "省级利用等别";
                        newRow["检查结果"] = "LYD值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    if (!int.TryParse(feature.get_Value(feature.Fields.FindField("DB")).ToString(), out formatInt))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "省级经济等别";
                        newRow["检查结果"] = "DB值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    List<bool> isRightList_sjzrdb = new List<bool>();
                    List<bool> isRightList_sjlydb = new List<bool>();
                    List<bool> isRightList_sjjjdb = new List<bool>();
                    #region 省级自然质量等别、省级利用等别、省级经济等别
                    //string provincezirandengSql = "select zirandengbie from zd_shengjidengbie where zirandeng_min<=" + provinceZiranzhiliangDengzhishu + " and zirandeng_max>" + provinceZiranzhiliangDengzhishu;
                    //string provinceliyongdengSql = "select liyongdengbie from zd_shengjidengbie where liyongdeng_min<=" + provinceLiyongDengzhishu + " and liyongdeng_max>" + provinceLiyongDengzhishu;
                    //string provincejingjidengSql = "select jingjidengbie from zd_shengjidengbie where jingjideng_min<=" + provinceJingjiDengzhishu + " and jingjideng_max>" + provinceJingjiDengzhishu;
                    //DataTable provincezirandengDt = m_dicAccessDB.getDataTable(provincezirandengSql);
                    //DataTable provinceliyongdengDt = m_dicAccessDB.getDataTable(provinceliyongdengSql);
                    //DataTable provincejingjidengDt = m_dicAccessDB.getDataTable(provincejingjidengSql);
                    //if (provincezirandengDt.Rows.Count > 0 && provinceliyongdengDt.Rows.Count > 0 && provincejingjidengDt.Rows.Count > 0)
                    //{
                    //    provinceZiranzhiliangDengbie = int.Parse(provincezirandengDt.Rows[0].ItemArray[0].ToString());//省级自然质量等别
                    //    provinceLiyongDengbie = int.Parse(provinceliyongdengDt.Rows[0].ItemArray[0].ToString());      //省级利用等别
                    //    provinceJingjiDengbie = int.Parse(provincejingjidengDt.Rows[0].ItemArray[0].ToString()); //省级经济等别
                    //}
                    for (int i = 0; i < sjdbDt.Rows.Count; i++)
                    {
                        if (double.Parse(sjdbDt.Rows[i]["zirandeng_min"].ToString()) < provinceZiranzhiliangDengzhishu && double.Parse(sjdbDt.Rows[i]["zirandeng_max"].ToString()) >= provinceZiranzhiliangDengzhishu)
                        {
                            provinceZiranzhiliangDengbie = int.Parse(sjdbDt.Rows[i]["zirandengbie"].ToString());
                        }
                        if (double.Parse(sjdbDt.Rows[i]["liyongdeng_min"].ToString()) < provinceLiyongDengzhishu && double.Parse(sjdbDt.Rows[i]["liyongdeng_max"].ToString()) >= provinceLiyongDengzhishu)
                        {
                            provinceLiyongDengbie = int.Parse(sjdbDt.Rows[i]["liyongdengbie"].ToString());
                        }
                        if (double.Parse(sjdbDt.Rows[i]["jingjideng_min"].ToString()) < provinceJingjiDengzhishu && double.Parse(sjdbDt.Rows[i]["jingjideng_max"].ToString()) >= provinceJingjiDengzhishu)
                        {
                            provinceJingjiDengbie = int.Parse(sjdbDt.Rows[i]["jingjidengbie"].ToString());
                        }
                    }
                    if (!(provinceZiranzhiliangDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("ZRDB")).ToString())))
                    {
                        isRightList_sjzrdb.Add(false);
                    }
                    if (!(provinceLiyongDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("LYD")).ToString())))
                    {
                        isRightList_sjlydb.Add(false);
                    }
                    if (!(provinceJingjiDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("DB")).ToString())))
                    {
                        isRightList_sjjjdb.Add(false);
                    }
                    provinceZiranzhiliangDengzhishu = provinceZiranzhiliangDengzhishu + 1;
                    provinceLiyongDengzhishu = provinceLiyongDengzhishu + 1;
                    provinceJingjiDengzhishu = provinceJingjiDengzhishu + 1;
                    //provincezirandengSql = "select zirandengbie from zd_shengjidengbie where zirandeng_min<=" + provinceZiranzhiliangDengzhishu + " and zirandeng_max>" + provinceZiranzhiliangDengzhishu;
                    //provinceliyongdengSql = "select liyongdengbie from zd_shengjidengbie where liyongdeng_min<=" + provinceLiyongDengzhishu + " and liyongdeng_max>" + provinceLiyongDengzhishu;
                    //provincejingjidengSql = "select jingjidengbie from zd_shengjidengbie where jingjideng_min<=" + provinceJingjiDengzhishu + " and jingjideng_max>" + provinceJingjiDengzhishu;
                    //provincezirandengDt =new DataTable ();
                    //provinceliyongdengDt = new DataTable();
                    //provincejingjidengDt = new DataTable();
                    //provincezirandengDt = m_dicAccessDB.getDataTable(provincezirandengSql);
                    //provinceliyongdengDt = m_dicAccessDB.getDataTable(provinceliyongdengSql);
                    //provincejingjidengDt = m_dicAccessDB.getDataTable(provincejingjidengSql);
                    //if (provincezirandengDt.Rows.Count > 0 && provinceliyongdengDt.Rows.Count > 0 && provincejingjidengDt.Rows.Count > 0)
                    //{
                    //    provinceZiranzhiliangDengbie = int.Parse(provincezirandengDt.Rows[0].ItemArray[0].ToString());//省级自然质量等别
                    //    provinceLiyongDengbie = int.Parse(provinceliyongdengDt.Rows[0].ItemArray[0].ToString());      //省级利用等别
                    //    provinceJingjiDengbie = int.Parse(provincejingjidengDt.Rows[0].ItemArray[0].ToString()); //省级经济等别
                    //}
                    for (int i = 0; i < sjdbDt.Rows.Count; i++)
                    {
                        if (double.Parse(sjdbDt.Rows[i]["zirandeng_min"].ToString()) < provinceZiranzhiliangDengzhishu && double.Parse(sjdbDt.Rows[i]["zirandeng_max"].ToString()) >= provinceZiranzhiliangDengzhishu)
                        {
                            provinceZiranzhiliangDengbie = int.Parse(sjdbDt.Rows[i]["zirandengbie"].ToString());
                        }
                        if (double.Parse(sjdbDt.Rows[i]["liyongdeng_min"].ToString()) < provinceLiyongDengzhishu && double.Parse(sjdbDt.Rows[i]["liyongdeng_max"].ToString()) >= provinceLiyongDengzhishu)
                        {
                            provinceLiyongDengbie = int.Parse(sjdbDt.Rows[i]["liyongdengbie"].ToString());
                        }
                        if (double.Parse(sjdbDt.Rows[i]["jingjideng_min"].ToString()) < provinceJingjiDengzhishu && double.Parse(sjdbDt.Rows[i]["jingjideng_max"].ToString()) >= provinceJingjiDengzhishu)
                        {
                            provinceJingjiDengbie = int.Parse(sjdbDt.Rows[i]["jingjidengbie"].ToString());
                        }
                    }
                    if (!(provinceZiranzhiliangDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("ZRDB")).ToString())))
                    {
                        isRightList_sjzrdb.Add(false);
                    }
                    if (!(provinceLiyongDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("LYD")).ToString())))
                    {
                        isRightList_sjlydb.Add(false);
                    }
                    if (!(provinceJingjiDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("DB")).ToString())))
                    {
                        isRightList_sjjjdb.Add(false);
                    }
                    provinceZiranzhiliangDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("ZRDZS")).ToString());
                    provinceZiranzhiliangDengzhishu = provinceZiranzhiliangDengzhishu - 1;
                    provinceLiyongDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("LYDZS")).ToString());
                    provinceLiyongDengzhishu = provinceLiyongDengzhishu - 1;
                    provinceJingjiDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("DBZ")).ToString());
                    provinceJingjiDengzhishu = provinceJingjiDengzhishu - 1;
                    //provincezirandengSql = "select zirandengbie from zd_shengjidengbie where zirandeng_min<=" + provinceZiranzhiliangDengzhishu + " and zirandeng_max>" + provinceZiranzhiliangDengzhishu;
                    //provinceliyongdengSql = "select liyongdengbie from zd_shengjidengbie where liyongdeng_min<=" + provinceLiyongDengzhishu + " and liyongdeng_max>" + provinceLiyongDengzhishu;
                    //provincejingjidengSql = "select jingjidengbie from zd_shengjidengbie where jingjideng_min<=" + provinceJingjiDengzhishu + " and jingjideng_max>" + provinceJingjiDengzhishu;
                    //provincezirandengDt = new DataTable();
                    //provinceliyongdengDt = new DataTable();
                    //provincejingjidengDt = new DataTable();
                    //provincezirandengDt = m_dicAccessDB.getDataTable(provincezirandengSql);
                    //provinceliyongdengDt = m_dicAccessDB.getDataTable(provinceliyongdengSql);
                    //provincejingjidengDt = m_dicAccessDB.getDataTable(provincejingjidengSql);
                    //if (provincezirandengDt.Rows.Count > 0 && provinceliyongdengDt.Rows.Count > 0 && provincejingjidengDt.Rows.Count > 0)
                    //{
                    //    provinceZiranzhiliangDengbie = int.Parse(provincezirandengDt.Rows[0].ItemArray[0].ToString());//省级自然质量等别
                    //    provinceLiyongDengbie = int.Parse(provinceliyongdengDt.Rows[0].ItemArray[0].ToString());      //省级利用等别
                    //    provinceJingjiDengbie = int.Parse(provincejingjidengDt.Rows[0].ItemArray[0].ToString()); //省级经济等别
                    //}

                    for (int i = 0; i < sjdbDt.Rows.Count; i++)
                    {
                        if (double.Parse(sjdbDt.Rows[i]["zirandeng_min"].ToString()) < provinceZiranzhiliangDengzhishu && double.Parse(sjdbDt.Rows[i]["zirandeng_max"].ToString()) >= provinceZiranzhiliangDengzhishu)
                        {
                            provinceZiranzhiliangDengbie = int.Parse(sjdbDt.Rows[i]["zirandengbie"].ToString());
                        }
                        if (double.Parse(sjdbDt.Rows[i]["liyongdeng_min"].ToString()) < provinceLiyongDengzhishu && double.Parse(sjdbDt.Rows[i]["liyongdeng_max"].ToString()) >= provinceLiyongDengzhishu)
                        {
                            provinceLiyongDengbie = int.Parse(sjdbDt.Rows[i]["liyongdengbie"].ToString());
                        }
                        if (double.Parse(sjdbDt.Rows[i]["jingjideng_min"].ToString()) < provinceJingjiDengzhishu && double.Parse(sjdbDt.Rows[i]["jingjideng_max"].ToString()) >= provinceJingjiDengzhishu)
                        {
                            provinceJingjiDengbie = int.Parse(sjdbDt.Rows[i]["jingjidengbie"].ToString());
                        }
                    }
                    if (!(provinceZiranzhiliangDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("ZRDB")).ToString())))
                    {
                        isRightList_sjzrdb.Add(false);
                    }
                    if (!(provinceLiyongDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("LYD")).ToString())))
                    {
                        isRightList_sjlydb.Add(false);
                    }
                    if (!(provinceJingjiDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("DB")).ToString())))
                    {
                        isRightList_sjjjdb.Add(false);
                    }
                    if (isRightList_sjzrdb.Count == 3)
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "省级自然质量等别";
                        newRow["检查结果"] = "计算值错误";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    if (isRightList_sjlydb.Count == 3)
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "省级利用等别";
                        newRow["检查结果"] = "计算值错误";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    if (isRightList_sjjjdb.Count == 3)
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "省级经济等别";
                        newRow["检查结果"] = "计算值错误";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    #endregion
                    #endregion
                    #region  国家自然质量等别、利用等别、经济等别（查询国家等别表）
                    int countyZiranzhiliangDengbie = 0;   //国家级自然质量等别
                    int countyLiyongDengbie = 0;          //国家级利用等别
                    int countyJingjiDengbie = 0;          //国家级经济等别
                    if (!int.TryParse(feature.get_Value(feature.Fields.FindField("GJZRDB")).ToString(), out formatInt))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "国家自然质量等别";
                        newRow["检查结果"] = "GJZRDB值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    if (!int.TryParse(feature.get_Value(feature.Fields.FindField("GJLYDB")).ToString(), out formatInt))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "国家级利用等别";
                        newRow["检查结果"] = "GJLYDB值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    if (!int.TryParse(feature.get_Value(feature.Fields.FindField("GJDB")).ToString(), out formatInt))
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "国家级经济等别";
                        newRow["检查结果"] = "GJDB值格式不正确";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    #region 检查方法
                    List<bool> isRightList_gjzrdb = new List<bool>();
                    List<bool> isRightList_gjlydb = new List<bool>();
                    List<bool> isRightList_gjjjdb = new List<bool>();
                    //string zirandengSql = "select zirandengbie from zd_guojiadengbie where zirandeng_min<=" + countyZiranzhiliangDengzhishu + " and zirandeng_max>" + countyZiranzhiliangDengzhishu;
                    //string liyongdengSql = "select liyongdengbie from zd_guojiadengbie where liyongdeng_min<=" + countyLiyongDengzhishu + " and liyongdeng_max>" + countyLiyongDengzhishu;
                    //string jingjidengSql = "select jingjidengbie from zd_guojiadengbie where jingjideng_min<=" + countyJingjiDengzhishu + " and jingjideng_max>" + countyJingjiDengzhishu;
                    //DataTable zirandengDt = m_dicAccessDB.getDataTable(zirandengSql);
                    //DataTable liyongdengDt = m_dicAccessDB.getDataTable(liyongdengSql);
                    //DataTable jingjidengDt = m_dicAccessDB.getDataTable(jingjidengSql);
                    //if (zirandengDt.Rows.Count > 0 && liyongdengDt.Rows.Count > 0 && jingjidengDt.Rows.Count > 0)
                    //{
                    //    countyZiranzhiliangDengbie = int.Parse(zirandengDt.Rows[0].ItemArray[0].ToString());//国家级自然质量等别
                    //    countyLiyongDengbie = int.Parse(liyongdengDt.Rows[0].ItemArray[0].ToString());      //国家级利用等别
                    //    countyJingjiDengbie = int.Parse(jingjidengDt.Rows[0].ItemArray[0].ToString()); //国家级经济等别
                    //}
                    for (int i = 0; i < gjdbDt.Rows.Count; i++)
                    {
                        if (double.Parse(gjdbDt.Rows[i]["zirandeng_min"].ToString()) <= countyZiranzhiliangDengzhishu && double.Parse(gjdbDt.Rows[i]["zirandeng_max"].ToString()) > countyZiranzhiliangDengzhishu)
                        {
                            countyZiranzhiliangDengbie = int.Parse(gjdbDt.Rows[i]["zirandengbie"].ToString());
                        }
                        if (double.Parse(gjdbDt.Rows[i]["liyongdeng_min"].ToString()) <= countyLiyongDengzhishu && double.Parse(gjdbDt.Rows[i]["liyongdeng_max"].ToString()) > countyLiyongDengzhishu)
                        {
                            countyLiyongDengbie = int.Parse(gjdbDt.Rows[i]["liyongdengbie"].ToString());
                        }
                        if (double.Parse(gjdbDt.Rows[i]["jingjideng_min"].ToString()) <= countyJingjiDengzhishu && double.Parse(gjdbDt.Rows[i]["jingjideng_max"].ToString()) > countyJingjiDengzhishu)
                        {
                            countyJingjiDengbie = int.Parse(gjdbDt.Rows[i]["jingjidengbie"].ToString());
                        }
                    }
                    if (!(countyZiranzhiliangDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("GJZRDB")).ToString())))
                    {
                        isRightList_gjzrdb.Add(false);
                    }
                    if (!(countyLiyongDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("GJLYDB")).ToString())))
                    {
                        isRightList_gjlydb.Add(false);
                    }
                    if (!(countyJingjiDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("GJDB")).ToString())))
                    {
                        isRightList_gjjjdb.Add(false);
                    }
                    countyZiranzhiliangDengzhishu = countyZiranzhiliangDengzhishu + 1;
                    countyLiyongDengzhishu = countyLiyongDengzhishu + 1;
                    countyJingjiDengzhishu = countyJingjiDengzhishu + 1;
                    //zirandengSql = "select zirandengbie from zd_guojiadengbie where zirandeng_min<=" + countyZiranzhiliangDengzhishu + " and zirandeng_max>" + countyZiranzhiliangDengzhishu;
                    //liyongdengSql = "select liyongdengbie from zd_guojiadengbie where liyongdeng_min<=" + countyLiyongDengzhishu + " and liyongdeng_max>" + countyLiyongDengzhishu;
                    //jingjidengSql = "select jingjidengbie from zd_guojiadengbie where jingjideng_min<=" + countyJingjiDengzhishu + " and jingjideng_max>" + countyJingjiDengzhishu;
                    //zirandengDt =new DataTable ();
                    //liyongdengDt=new DataTable ();
                    //jingjidengDt = new DataTable();                   
                    //zirandengDt = m_dicAccessDB.getDataTable(zirandengSql);
                    //liyongdengDt = m_dicAccessDB.getDataTable(liyongdengSql);
                    //jingjidengDt = m_dicAccessDB.getDataTable(jingjidengSql);
                    //if (zirandengDt.Rows.Count > 0 && liyongdengDt.Rows.Count > 0 && jingjidengDt.Rows.Count > 0)
                    //{
                    //    countyZiranzhiliangDengbie = int.Parse(zirandengDt.Rows[0].ItemArray[0].ToString());//国家级自然质量等别
                    //    countyLiyongDengbie = int.Parse(liyongdengDt.Rows[0].ItemArray[0].ToString());      //国家级利用等别
                    //    countyJingjiDengbie = int.Parse(jingjidengDt.Rows[0].ItemArray[0].ToString()); //国家级经济等别
                    //}
                    for (int i = 0; i < gjdbDt.Rows.Count; i++)
                    {
                        if (double.Parse(gjdbDt.Rows[i]["zirandeng_min"].ToString()) <= countyZiranzhiliangDengzhishu && double.Parse(gjdbDt.Rows[i]["zirandeng_max"].ToString()) > countyZiranzhiliangDengzhishu)
                        {
                            countyZiranzhiliangDengbie = int.Parse(gjdbDt.Rows[i]["zirandengbie"].ToString());
                        }
                        if (double.Parse(gjdbDt.Rows[i]["liyongdeng_min"].ToString()) <= countyLiyongDengzhishu && double.Parse(gjdbDt.Rows[i]["liyongdeng_max"].ToString()) > countyLiyongDengzhishu)
                        {
                            countyLiyongDengbie = int.Parse(gjdbDt.Rows[i]["liyongdengbie"].ToString());
                        }
                        if (double.Parse(gjdbDt.Rows[i]["jingjideng_min"].ToString()) <= countyJingjiDengzhishu && double.Parse(gjdbDt.Rows[i]["jingjideng_max"].ToString()) > countyJingjiDengzhishu)
                        {
                            countyJingjiDengbie = int.Parse(gjdbDt.Rows[i]["jingjidengbie"].ToString());
                        }
                    }
                    if (!(countyZiranzhiliangDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("GJZRDB")).ToString())))
                    {
                        isRightList_gjzrdb.Add(false);
                    }
                    if (!(countyLiyongDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("GJLYDB")).ToString())))
                    {
                        isRightList_gjlydb.Add(false);
                    }
                    if (!(countyJingjiDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("GJDB")).ToString())))
                    {
                        isRightList_gjjjdb.Add(false);
                    }
                    countyZiranzhiliangDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("GJZRDZS")).ToString());
                    countyZiranzhiliangDengzhishu = countyZiranzhiliangDengzhishu - 1;
                    countyLiyongDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("GJLYDZS")).ToString());
                    countyLiyongDengzhishu = countyLiyongDengzhishu - 1;
                    countyJingjiDengzhishu = double.Parse(feature.get_Value(feature.Fields.FindField("GJDBZS")).ToString());
                    countyJingjiDengzhishu = countyJingjiDengzhishu - 1;
                    //zirandengSql = "select zirandengbie from zd_guojiadengbie where zirandeng_min<=" + countyZiranzhiliangDengzhishu + " and zirandeng_max>" + countyZiranzhiliangDengzhishu;
                    //liyongdengSql = "select liyongdengbie from zd_guojiadengbie where liyongdeng_min<=" + countyLiyongDengzhishu + " and liyongdeng_max>" + countyLiyongDengzhishu;
                    //jingjidengSql = "select jingjidengbie from zd_guojiadengbie where jingjideng_min<=" + countyJingjiDengzhishu + " and jingjideng_max>" + countyJingjiDengzhishu;
                    //zirandengDt = new DataTable();
                    //liyongdengDt = new DataTable();
                    //jingjidengDt = new DataTable();                      
                    //zirandengDt = m_dicAccessDB.getDataTable(zirandengSql);
                    //liyongdengDt = m_dicAccessDB.getDataTable(liyongdengSql);
                    //jingjidengDt = m_dicAccessDB.getDataTable(jingjidengSql);
                    //if (zirandengDt.Rows.Count > 0 && liyongdengDt.Rows.Count > 0 && jingjidengDt.Rows.Count > 0)
                    //{
                    //    countyZiranzhiliangDengbie = int.Parse(zirandengDt.Rows[0].ItemArray[0].ToString());//国家级自然质量等别
                    //    countyLiyongDengbie = int.Parse(liyongdengDt.Rows[0].ItemArray[0].ToString());      //国家级利用等别
                    //    countyJingjiDengbie = int.Parse(jingjidengDt.Rows[0].ItemArray[0].ToString()); //国家级经济等别
                    //}
                    for (int i = 0; i < gjdbDt.Rows.Count; i++)
                    {
                        if (double.Parse(gjdbDt.Rows[i]["zirandeng_min"].ToString()) <= countyZiranzhiliangDengzhishu && double.Parse(gjdbDt.Rows[i]["zirandeng_max"].ToString()) > countyZiranzhiliangDengzhishu)
                        {
                            countyZiranzhiliangDengbie = int.Parse(gjdbDt.Rows[i]["zirandengbie"].ToString());
                        }
                        if (double.Parse(gjdbDt.Rows[i]["liyongdeng_min"].ToString()) <= countyLiyongDengzhishu && double.Parse(gjdbDt.Rows[i]["liyongdeng_max"].ToString()) > countyLiyongDengzhishu)
                        {
                            countyLiyongDengbie = int.Parse(gjdbDt.Rows[i]["liyongdengbie"].ToString());
                        }
                        if (double.Parse(gjdbDt.Rows[i]["jingjideng_min"].ToString()) <= countyJingjiDengzhishu && double.Parse(gjdbDt.Rows[i]["jingjideng_max"].ToString()) > countyJingjiDengzhishu)
                        {
                            countyJingjiDengbie = int.Parse(gjdbDt.Rows[i]["jingjidengbie"].ToString());
                        }
                    }
                    if (!(countyZiranzhiliangDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("GJZRDB")).ToString())))
                    {
                        isRightList_gjzrdb.Add(false);
                    }
                    if (!(countyLiyongDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("GJLYDB")).ToString())))
                    {
                        isRightList_gjlydb.Add(false);
                    }
                    if (!(countyJingjiDengbie == int.Parse(feature.get_Value(feature.Fields.FindField("GJDB")).ToString())))
                    {
                        isRightList_gjjjdb.Add(false);
                    }
                    if (isRightList_gjzrdb.Count == 3)
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "国家级自然质量等别";
                        newRow["检查结果"] = "计算值错误";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    if (isRightList_gjlydb.Count == 3)
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "国家级利用等别";
                        newRow["检查结果"] = "计算值错误";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    if (isRightList_gjjjdb.Count == 3)
                    {
                        DataRow newRow = evolutionChkResultDt.NewRow();
                        newRow["县名称"] = xmc;
                        newRow["乡镇"] = xz;
                        newRow["县级分等单元编号"] = sjdybh;
                        newRow["计算的评价指数"] = "国家级经济等别";
                        newRow["检查结果"] = "计算值错误";
                        evolutionChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    #endregion
                    #endregion
                    feature = featureCursor.NextFeature();
                }
                resultChkDtArray[0] = referenceIndexChkResultDt;//参数检查结果表
                resultChkDtArray[1] = dileiChkResultDt;//地类检查结果表
                resultChkDtArray[2] = evolutionChkResultDt;//评价结果计算表
            }
            catch (Exception ex)
            {
                if (ex.Message.ToString().Contains("not within the valid range"))
                {
                    MessageBox.Show("参数检查过程中出现错误：出现非法字段（与成果要求不一致）");
                }
                else MessageBox.Show("参数检查过程中出现错误：" + exceptionInfo + ex.Message);
                return resultChkDtArray;
            }
            return resultChkDtArray;
        }

        /// <summary>因素分值检查
        /// </summary>
        /// <param name="featureClass"></param>
        /// <returns></returns>
        public DataTable GetIndexScoreCheckDt(IFeatureClass featureClass)
        {
            DataTable indexScoreChkResultDt = new DataTable();
            string[] indexValueArray = new string[10];
            string[] indexNameArray = { "DXPD", "TMPD", "DXSW", "YXTCHD", "BTZD", "PMGX", "YJZHL", "PHZ", "GGBZL", "PSTJ" };
            string exceptionInfo = "";
            #region 初始化参数检查结果表列
            DataColumn column = new DataColumn("县名称");
            indexScoreChkResultDt.Columns.Add(column);
            column = new DataColumn("乡镇");
            indexScoreChkResultDt.Columns.Add(column);
            column = new DataColumn("县级分等单元编号");
            indexScoreChkResultDt.Columns.Add(column);
            column = new DataColumn("分等因素名称");
            indexScoreChkResultDt.Columns.Add(column);
            column = new DataColumn("检查结果");
            indexScoreChkResultDt.Columns.Add(column);
            #endregion
            try
            {
                IQueryFilter queryFilter = new QueryFilter();
                IFeatureCursor featureCursor = featureClass.Search(null, true);
                IFeature feature = featureCursor.NextFeature();

                //获取地市名
                string xmc = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();
                //查耕作制度分区表获取该地市的国家一级区
                string gzzdfqSQL = "select CountryFirstRegion from zd_gengzuozhidufenqu where QXNAME = '" + xmc + "'";
                DataTable gjyjqDt = m_dicAccessDB.getDataTable(gzzdfqSQL);
                if (gjyjqDt.Rows.Count < 1)
                {
                    DataRow newRow = indexScoreChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = "";
                    newRow[2] = "";
                    newRow[3] = "";
                    newRow[4] = "无此区县国家一级区信息";
                    indexScoreChkResultDt.Rows.Add(newRow);
                    return indexScoreChkResultDt;
                }
                string gjyjq = "";
                if (gjyjqDt.Rows.Count > 0)
                {
                    gjyjq = gjyjqDt.Rows[0]["CountryFirstRegion"].ToString().Trim();
                }
                if (feature == null) return null;
                string[] dldmArray = { "114K", "011", "012" }; //地类编码作为水田的地类代码数组
                //获取分等因素分值标准表
                DataTable fdysfzDt = new DataTable();
                string sql = "select * from zd_fendengyinsufenzhi";
                fdysfzDt = m_dicAccessDB.getDataTable(sql);
                if (fdysfzDt.Rows.Count < 1)
                {
                    DataRow newRow = indexScoreChkResultDt.NewRow();
                    newRow[0] = xmc;
                    newRow[1] = "";
                    newRow[2] = "";
                    newRow[3] = "";
                    newRow[4] = "参考字典表中无此区县记录";
                    indexScoreChkResultDt.Rows.Add(newRow);
                    return indexScoreChkResultDt;
                }
                int formatInt = 0;
                double formatDouble = 0.0;
                while (feature != null)
                {
                    xmc = feature.get_Value(feature.Fields.FindField("X")).ToString().Trim();//获取数据库的县名称
                    string xz = feature.get_Value(feature.Fields.FindField("XZ")).ToString().Trim();
                    string sjdybh = feature.get_Value(feature.Fields.FindField("XJDYBH")).ToString().Trim();
                    string gzzd = feature.get_Value(feature.Fields.FindField("GJGZZD")).ToString().Trim();
                    string feature_SZ = feature.get_Value(feature.Fields.FindField("SZ")).ToString().Trim(); //获取熟制（SZ)//用于判断中稻的情况
                    exceptionInfo = "记录 '" + sjdybh + "'错误";
                    //获取10个分等因素的值
                    for (int i = 0; i < indexValueArray.Length; i++)
                    {
                        indexValueArray[i] = feature.get_Value(feature.Fields.FindField(indexNameArray[i].ToString().Trim())).ToString().Trim();
                    }
                    //判断地类
                    string dldm = feature.get_Value(feature.Fields.FindField("DLDM")).ToString().Trim();
                    #region 处理广州市的一些特殊情况
                    string[] unNormalRegionArray = { "天河区", "海珠区", "番禺区", "萝岗区", "花都区", "南沙区", "黄埔区", "荔湾区", "白云区", "东莞市", "南海区", "禅城区", "顺德区", "中山市", "光明新区", "坪山新区", "龙岗区", "福田区", "南山区", "宝安区", "盐田区", "罗湖区" };
                    if (unNormalRegionArray.Contains(xmc) && !xz.Equals("永和街道"))
                    {
                        dldm = "011";//全部做水田处理
                    }
                    #endregion
                    //地形
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField(indexNameArray[0])).ToString(), out formatDouble))
                    {
                        DataRow newRow = indexScoreChkResultDt.NewRow();
                        newRow[0] = xmc;
                        newRow[1] = xz;
                        newRow[2] = sjdybh;
                        newRow[3] = indexNameArray[0];
                        newRow[4] = "值格式不正确";
                        indexScoreChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    //田面坡度
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField(indexNameArray[1])).ToString(), out formatDouble))
                    {
                        DataRow newRow = indexScoreChkResultDt.NewRow();
                        newRow[0] = xmc;
                        newRow[1] = xz;
                        newRow[2] = sjdybh;
                        newRow[3] = indexNameArray[1];
                        newRow[4] = "值格式不正确";
                        indexScoreChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    //地下水位
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField(indexNameArray[2])).ToString(), out formatDouble))
                    {
                        DataRow newRow = indexScoreChkResultDt.NewRow();
                        newRow[0] = xmc;
                        newRow[1] = xz;
                        newRow[2] = sjdybh;
                        newRow[3] = indexNameArray[2];
                        newRow[4] = "值格式不正确";
                        indexScoreChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    //有效土层厚度
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField(indexNameArray[3])).ToString(), out formatDouble))
                    {
                        DataRow newRow = indexScoreChkResultDt.NewRow();
                        newRow[0] = xmc;
                        newRow[1] = xz;
                        newRow[2] = sjdybh;
                        newRow[3] = indexNameArray[3];
                        newRow[4] = "值格式不正确";
                        indexScoreChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    //有机质含量
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField(indexNameArray[6])).ToString(), out formatDouble))
                    {
                        DataRow newRow = indexScoreChkResultDt.NewRow();
                        newRow[0] = xmc;
                        newRow[1] = xz;
                        newRow[2] = sjdybh;
                        newRow[3] = indexNameArray[6];
                        newRow[4] = "值格式不正确";
                        indexScoreChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    //PH值
                    if (!double.TryParse(feature.get_Value(feature.Fields.FindField(indexNameArray[7])).ToString(), out formatDouble))
                    {
                        DataRow newRow = indexScoreChkResultDt.NewRow();
                        newRow[0] = xmc;
                        newRow[1] = xz;
                        newRow[2] = sjdybh;
                        newRow[3] = indexNameArray[7];
                        newRow[4] = "值格式不正确";
                        indexScoreChkResultDt.Rows.Add(newRow);
                        feature = featureCursor.NextFeature();
                        continue;
                    }
                    #region 检查指定作物的十个因素分值
                    if (dldmArray.Contains(dldm))// 基准作物，早稻，冬甘薯,中稻
                    {
                        if (feature_SZ.Contains("一年一熟")) // 中稻
                        {
                            int[] shuidaofenzhiArray = new int[10];
                            for (int i = 0; i < fdysfzDt.Rows.Count; i++)
                            {
                                #region 确定水稻分等因素的分值标准
                                if (fdysfzDt.Rows[i]["ZuoWu"].ToString().Trim().Equals("水稻"))
                                {
                                    //地形
                                    if (!fdysfzDt.Rows[i]["DX_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["DX_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[0].Trim()) && double.Parse(fdysfzDt.Rows[i]["DX_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[0].Trim()))
                                        {
                                            shuidaofenzhiArray[0] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //田面坡度
                                    if (!fdysfzDt.Rows[i]["TMPD_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["TMPD_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[1].Trim()) && double.Parse(fdysfzDt.Rows[i]["TMPD_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[1].Trim()))
                                        {
                                            shuidaofenzhiArray[1] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //地下水位
                                    if (!fdysfzDt.Rows[i]["DXSW_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["DXSW_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[2].Trim()) && double.Parse(fdysfzDt.Rows[i]["DXSW_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[2].Trim()))
                                        {
                                            shuidaofenzhiArray[2] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //有效土层厚度
                                    if (!fdysfzDt.Rows[i]["YXTCHD_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["YXTCHD_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[3].Trim()) && double.Parse(fdysfzDt.Rows[i]["YXTCHD_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[3]))
                                        {
                                            shuidaofenzhiArray[3] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //表土质地
                                    if (fdysfzDt.Rows[i]["BTZD"].ToString().Trim().Equals(indexValueArray[4]))
                                    {
                                        shuidaofenzhiArray[4] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                    if (gjyjq.Equals("江南区")) //剖面构型(江南区）
                                    {
                                        if (fdysfzDt.Rows[i]["PMGX_JN"].ToString().Trim().Equals(indexValueArray[5]))
                                        {
                                            shuidaofenzhiArray[5] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    if (gjyjq.Equals("华南区"))//剖面构型（华南区）
                                    {
                                        if (fdysfzDt.Rows[i]["PMGX_HN"].ToString().Trim().Equals(indexValueArray[5]))
                                        {
                                            shuidaofenzhiArray[5] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //有机质含量
                                    if (!fdysfzDt.Rows[i]["YJZHL_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["YJZHL_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[6].Trim()) && double.Parse(fdysfzDt.Rows[i]["YJZHL_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[6].Trim()))
                                        {
                                            shuidaofenzhiArray[6] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //PH值
                                    if (!fdysfzDt.Rows[i]["PHZ_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["PHZ_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[7].Trim()) && double.Parse(fdysfzDt.Rows[i]["PHZ_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[7].Trim()))
                                        {
                                            shuidaofenzhiArray[7] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //灌溉保证率
                                    if (fdysfzDt.Rows[i]["GGBZL"].ToString().Trim().Equals(indexValueArray[8]))
                                    {
                                        shuidaofenzhiArray[8] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                    //排水条件
                                    if (fdysfzDt.Rows[i]["PSTJ"].ToString().Trim().Equals(indexValueArray[9]))
                                    {
                                        shuidaofenzhiArray[9] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                }
                                #endregion
                            }
                            #region 指定作物5分等因素分值（中稻）
                            bool breakflag = false;
                            int[] ZD5fenzhiChkArray = new int[10];
                            string[] ZD5fenzhiChkNameArray;
                            bool bZD5fengzhiCHk = false;
                            for (int k = 0; k < feature.Fields.FieldCount; k++)
                            {
                                if (feature.Fields.Field[k].Name.Equals("ZD5YXTCHDFZ"))
                                {
                                    bZD5fengzhiCHk = true;
                                }
                            }
                            if (bZD5fengzhiCHk)
                            {
                                ZD5fenzhiChkNameArray = new string[] { "ZD5DXFZ", "ZD5TMPDFZ", "ZD5DXSWFZ", "ZD5YXTCHDFZ", "ZD5BTZDFZ", "ZD5PMGXFZ", "ZD5YJZHLFZ", "ZD5PHFZ", "ZD5GGBZLFZ", "ZD5PSTJFZ" };
                            }
                            else
                            {
                                ZD5fenzhiChkNameArray = new string[] { "ZD5DXFZ", "ZD5TMPDFZ", "ZD5DXSWFZ", "ZD5YXTCHDF", "ZD5BTZDFZ", "ZD5PMGXFZ", "ZD5YJZHLFZ", "ZD5PHFZ", "ZD5GGBZLFZ", "ZD5PSTJFZ" };
                            }
                            for (int i = 0; i < ZD5fenzhiChkNameArray.Length; i++)
                            {
                                if (!int.TryParse(feature.get_Value(feature.Fields.FindField(ZD5fenzhiChkNameArray[i])).ToString(), out formatInt))
                                {
                                    DataRow newRow = indexScoreChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = ZD5fenzhiChkNameArray[i];
                                    newRow[4] = "值格式不正确";
                                    breakflag = true;
                                    indexScoreChkResultDt.Rows.Add(newRow);
                                    continue;
                                }
                                ZD5fenzhiChkArray[i] = int.Parse(feature.get_Value(feature.Fields.FindField(ZD5fenzhiChkNameArray[i])).ToString());
                            }
                            if (breakflag)
                            {
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            #endregion
                            #region 检查
                            for (int i = 0; i < 10; i++)
                            {
                                if (ZD5fenzhiChkArray[i] != shuidaofenzhiArray[i])//指定作物5
                                {
                                    DataRow newRow = indexScoreChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = ZD5fenzhiChkNameArray[i];
                                    newRow[4] = "选择不正确";
                                    indexScoreChkResultDt.Rows.Add(newRow);
                                }
                            }
                            #endregion
                        }
                        else  // 基准作物，早稻，冬甘薯
                        {
                            int[] shuidaofenzhiArray = new int[10];
                            int[] ganshufenzhiArray = new int[10];
                            for (int i = 0; i < fdysfzDt.Rows.Count; i++)
                            {
                                #region 确定水稻分等因素的分值标准
                                if (fdysfzDt.Rows[i]["ZuoWu"].ToString().Trim().Equals("水稻"))
                                {
                                    //地形
                                    if (!fdysfzDt.Rows[i]["DX_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["DX_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[0].Trim()) && double.Parse(fdysfzDt.Rows[i]["DX_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[0].Trim()))
                                        {
                                            shuidaofenzhiArray[0] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //田面坡度
                                    if (!fdysfzDt.Rows[i]["TMPD_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["TMPD_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[1].Trim()) && double.Parse(fdysfzDt.Rows[i]["TMPD_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[1].Trim()))
                                        {
                                            shuidaofenzhiArray[1] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //地下水位
                                    if (!fdysfzDt.Rows[i]["DXSW_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["DXSW_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[2].Trim()) && double.Parse(fdysfzDt.Rows[i]["DXSW_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[2].Trim()))
                                        {
                                            shuidaofenzhiArray[2] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //有效土层厚度
                                    if (!fdysfzDt.Rows[i]["YXTCHD_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["YXTCHD_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[3].Trim()) && double.Parse(fdysfzDt.Rows[i]["YXTCHD_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[3]))
                                        {
                                            shuidaofenzhiArray[3] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //表土质地
                                    if (fdysfzDt.Rows[i]["BTZD"].ToString().Trim().Equals(indexValueArray[4]))
                                    {
                                        shuidaofenzhiArray[4] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                    if (gjyjq.Equals("江南区")) //剖面构型(江南区）
                                    {
                                        if (fdysfzDt.Rows[i]["PMGX_JN"].ToString().Trim().Equals(indexValueArray[5]))
                                        {
                                            shuidaofenzhiArray[5] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    if (gjyjq.Equals("华南区"))//剖面构型（华南区）
                                    {
                                        if (fdysfzDt.Rows[i]["PMGX_HN"].ToString().Trim().Equals(indexValueArray[5]))
                                        {
                                            shuidaofenzhiArray[5] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //有机质含量
                                    if (!fdysfzDt.Rows[i]["YJZHL_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["YJZHL_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[6].Trim()) && double.Parse(fdysfzDt.Rows[i]["YJZHL_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[6].Trim()))
                                        {
                                            shuidaofenzhiArray[6] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //PH值
                                    if (!fdysfzDt.Rows[i]["PHZ_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["PHZ_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[7].Trim()) && double.Parse(fdysfzDt.Rows[i]["PHZ_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[7].Trim()))
                                        {
                                            shuidaofenzhiArray[7] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //灌溉保证率
                                    if (fdysfzDt.Rows[i]["GGBZL"].ToString().Trim().Equals(indexValueArray[8]))
                                    {
                                        shuidaofenzhiArray[8] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                    //排水条件
                                    if (fdysfzDt.Rows[i]["PSTJ"].ToString().Trim().Equals(indexValueArray[9]))
                                    {
                                        shuidaofenzhiArray[9] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }

                                }
                                #endregion
                                #region 确定甘薯分等因素的分值标准
                                if (fdysfzDt.Rows[i]["ZuoWu"].ToString().Trim().Equals("甘薯"))
                                {
                                    //地形
                                    if (!fdysfzDt.Rows[i]["DX_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["DX_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[0].Trim()) && double.Parse(fdysfzDt.Rows[i]["DX_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[0].Trim()))
                                        {
                                            ganshufenzhiArray[0] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //田面坡度
                                    if (!fdysfzDt.Rows[i]["TMPD_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["TMPD_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[1].Trim()) && double.Parse(fdysfzDt.Rows[i]["TMPD_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[1].Trim()))
                                        {
                                            ganshufenzhiArray[1] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //地下水位
                                    if (!fdysfzDt.Rows[i]["DXSW_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["DXSW_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[2].Trim()) && double.Parse(fdysfzDt.Rows[i]["DXSW_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[2].Trim()))
                                        {
                                            ganshufenzhiArray[2] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //有效土层厚度
                                    if (!fdysfzDt.Rows[i]["YXTCHD_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["YXTCHD_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[3].Trim()) && double.Parse(fdysfzDt.Rows[i]["YXTCHD_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[3]))
                                        {
                                            ganshufenzhiArray[3] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //表土质地
                                    if (fdysfzDt.Rows[i]["BTZD"].ToString().Trim().Equals(indexValueArray[4]))
                                    {
                                        ganshufenzhiArray[4] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                    if (gjyjq.Equals("江南区")) //剖面构型(江南区）
                                    {
                                        if (fdysfzDt.Rows[i]["PMGX_JN"].ToString().Trim().Equals(indexValueArray[5]))
                                        {
                                            ganshufenzhiArray[5] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    if (gjyjq.Equals("华南区"))//剖面构型（华南区）
                                    {
                                        if (fdysfzDt.Rows[i]["PMGX_HN"].ToString().Trim().Equals(indexValueArray[5]))
                                        {
                                            ganshufenzhiArray[5] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //有机质含量
                                    if (!fdysfzDt.Rows[i]["YJZHL_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["YJZHL_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[6].Trim()) && double.Parse(fdysfzDt.Rows[i]["YJZHL_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[6].Trim()))
                                        {
                                            ganshufenzhiArray[6] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //PH值
                                    if (!fdysfzDt.Rows[i]["PHZ_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["PHZ_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[7].Trim()) && double.Parse(fdysfzDt.Rows[i]["PHZ_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[7].Trim()))
                                        {
                                            ganshufenzhiArray[7] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //灌溉保证率
                                    if (fdysfzDt.Rows[i]["GGBZL"].ToString().Trim().Equals(indexValueArray[8]))
                                    {
                                        ganshufenzhiArray[8] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                    //排水条件
                                    if (fdysfzDt.Rows[i]["PSTJ"].ToString().Trim().Equals(indexValueArray[9]))
                                    {
                                        ganshufenzhiArray[9] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }

                                }
                                #endregion
                            }
                            #region 基准作物分等因素分值（晚稻）
                            bool breakflag = false;
                            int[] JZfenzhiChkArray = new int[10];
                            string[] JZfenzhiChkNameArray = { "JZDXFZ", "JZTMPDFZ", "JZDXSWFZ", "JZYXTCHDFZ", "JZBTZDFZ", "JZPMGXFZ", "JZYJZHLFZ", "JZPHFZ", "JZGGBZLFZ", "JZPSTJFZ" };
                            for (int i = 0; i < JZfenzhiChkArray.Length; i++)
                            {
                                if (!int.TryParse(feature.get_Value(feature.Fields.FindField(JZfenzhiChkNameArray[i])).ToString(), out formatInt))
                                {
                                    DataRow newRow = indexScoreChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = JZfenzhiChkNameArray[i];
                                    newRow[4] = "值格式不正确";
                                    breakflag = true;
                                    indexScoreChkResultDt.Rows.Add(newRow);
                                    continue;
                                }
                                JZfenzhiChkArray[i] = int.Parse(feature.get_Value(feature.Fields.FindField(JZfenzhiChkNameArray[i])).ToString());
                            }
                            if (breakflag)
                            {
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            #endregion
                            #region 指定作物1分等因素分值（早稻）
                            int[] ZD1fenzhiChkArray = new int[10];
                            string[] ZD1fenzhiChkNameArray;
                            bool yxtc1OK = false;
                            for (int k = 0; k < feature.Fields.FieldCount; k++)
                            {
                                if (feature.Fields.Field[k].Name.Equals("ZD1YXTCHDFZ"))
                                {
                                    yxtc1OK = true;
                                }
                            }
                            if (yxtc1OK)
                            {
                                ZD1fenzhiChkNameArray = new string[] { "ZD1DXFZ", "ZD1TMPDFZ", "ZD1DXSWFZ", "ZD1YXTCHDFZ", "ZD1BTZDFZ", "ZD1PMGXFZ", "ZD1YJZHLFZ", "ZD1PHFZ", "ZD1GGBZLFZ", "ZD1PSTJFZ" };
                            }
                            else
                            {
                                ZD1fenzhiChkNameArray = new string[] { "ZD1DXFZ", "ZD1TMPDFZ", "ZD1DXSWFZ", "ZD1YXTCHDF", "ZD1BTZDFZ", "ZD1PMGXFZ", "ZD1YJZHLFZ", "ZD1PHFZ", "ZD1GGBZLFZ", "ZD1PSTJFZ" };
                            }
                            for (int i = 0; i < ZD1fenzhiChkArray.Length; i++)
                            {
                                if (!int.TryParse(feature.get_Value(feature.Fields.FindField(ZD1fenzhiChkNameArray[i])).ToString(), out formatInt))
                                {
                                    DataRow newRow = indexScoreChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = ZD1fenzhiChkNameArray[i];
                                    newRow[4] = "值格式不正确";
                                    breakflag = true;
                                    indexScoreChkResultDt.Rows.Add(newRow);
                                    continue;
                                }
                                ZD1fenzhiChkArray[i] = int.Parse(feature.get_Value(feature.Fields.FindField(ZD1fenzhiChkNameArray[i])).ToString());
                            }
                            if (breakflag)
                            {
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            #endregion
                            #region 指定作物2分等因素分值（冬甘薯）
                            int[] ZD2fenzhiChkArray = new int[10];
                            string[] ZD2fenzhiChkNameArray;
                            bool yxtc2OK = false;
                            for (int k = 0; k < feature.Fields.FieldCount; k++)
                            {
                                if (feature.Fields.Field[k].Name.Equals("ZD2YXTCHDFZ"))
                                {
                                    yxtc2OK = true;
                                }
                            }
                            if (yxtc2OK)
                            {
                                ZD2fenzhiChkNameArray = new string[] { "ZD2DXFZ", "ZD2TMPDFZ", "ZD2DXSWFZ", "ZD2YXTCHDFZ", "ZD2BTZDFZ", "ZD2PMGXFZ", "ZD2YJZHLFZ", "ZD2PHFZ", "ZD2GGBZLFZ", "ZD2PSTJFZ" };
                            }
                            else
                            {
                                ZD2fenzhiChkNameArray = new string[] { "ZD2DXFZ", "ZD2TMPDFZ", "ZD2DXSWFZ", "ZD2YXTCHDF", "ZD2BTZDFZ", "ZD2PMGXFZ", "ZD2YJZHLFZ", "ZD2PHFZ", "ZD2GGBZLFZ", "ZD2PSTJFZ" };
                            }
                            if (gzzd.Contains("薯"))
                            {
                                for (int i = 0; i < ZD2fenzhiChkArray.Length; i++)
                                {
                                    if (!int.TryParse(feature.get_Value(feature.Fields.FindField(ZD2fenzhiChkNameArray[i])).ToString(), out formatInt))
                                    {
                                        DataRow newRow = indexScoreChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = ZD2fenzhiChkNameArray[i];
                                        newRow[4] = "值格式不正确";
                                        breakflag = true;
                                        indexScoreChkResultDt.Rows.Add(newRow);
                                        continue;
                                    }
                                    ZD2fenzhiChkArray[i] = int.Parse(feature.get_Value(feature.Fields.FindField(ZD2fenzhiChkNameArray[i])).ToString());
                                }
                            }
                            if (breakflag)
                            {
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            #endregion
                            #region 检查
                            for (int i = 0; i < 10; i++)
                            {
                                if (gzzd.Contains("薯"))
                                {
                                    if (JZfenzhiChkArray[i] != shuidaofenzhiArray[i])//基准作物
                                    {
                                        DataRow newRow = indexScoreChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = JZfenzhiChkNameArray[i];
                                        newRow[4] = "选择不正确";
                                        indexScoreChkResultDt.Rows.Add(newRow);
                                    }
                                    if (ZD1fenzhiChkArray[i] != shuidaofenzhiArray[i])//指定作物1
                                    {
                                        DataRow newRow = indexScoreChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = ZD1fenzhiChkNameArray[i];
                                        newRow[4] = "选择不正确";
                                        indexScoreChkResultDt.Rows.Add(newRow);
                                    }
                                    if (ZD2fenzhiChkArray[i] != ganshufenzhiArray[i])//指定作物2
                                    {
                                        DataRow newRow = indexScoreChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = ZD2fenzhiChkNameArray[i];
                                        newRow[4] = "选择不正确";
                                        indexScoreChkResultDt.Rows.Add(newRow);
                                    }
                                }
                                else
                                {
                                    if (JZfenzhiChkArray[i] != shuidaofenzhiArray[i])//基准作物
                                    {
                                        DataRow newRow = indexScoreChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = JZfenzhiChkNameArray[i];
                                        newRow[4] = "选择不正确";
                                        indexScoreChkResultDt.Rows.Add(newRow);
                                    }
                                    if (ZD1fenzhiChkArray[i] != shuidaofenzhiArray[i])//指定作物1
                                    {
                                        DataRow newRow = indexScoreChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = ZD1fenzhiChkNameArray[i];
                                        newRow[4] = "选择不正确";
                                        indexScoreChkResultDt.Rows.Add(newRow);
                                    }
                                }
                            }
                            #endregion
                        }
                    }
                    else//春花生，秋甘薯
                    {
                        if (feature_SZ.Contains("一年一熟")) // 中稻
                        {
                            int[] shuidaofenzhiArray = new int[10];
                            for (int i = 0; i < fdysfzDt.Rows.Count; i++)
                            {
                                #region 确定水稻分等因素的分值标准
                                if (fdysfzDt.Rows[i]["ZuoWu"].ToString().Trim().Equals("水稻"))
                                {
                                    //地形
                                    if (!fdysfzDt.Rows[i]["DX_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["DX_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[0].Trim()) && double.Parse(fdysfzDt.Rows[i]["DX_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[0].Trim()))
                                        {
                                            shuidaofenzhiArray[0] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //田面坡度
                                    if (!fdysfzDt.Rows[i]["TMPD_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["TMPD_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[1].Trim()) && double.Parse(fdysfzDt.Rows[i]["TMPD_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[1].Trim()))
                                        {
                                            shuidaofenzhiArray[1] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //地下水位
                                    if (!fdysfzDt.Rows[i]["DXSW_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["DXSW_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[2].Trim()) && double.Parse(fdysfzDt.Rows[i]["DXSW_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[2].Trim()))
                                        {
                                            shuidaofenzhiArray[2] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //有效土层厚度
                                    if (!fdysfzDt.Rows[i]["YXTCHD_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["YXTCHD_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[3].Trim()) && double.Parse(fdysfzDt.Rows[i]["YXTCHD_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[3]))
                                        {
                                            shuidaofenzhiArray[3] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //表土质地
                                    if (fdysfzDt.Rows[i]["BTZD"].ToString().Trim().Equals(indexValueArray[4]))
                                    {
                                        shuidaofenzhiArray[4] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                    if (gjyjq.Equals("江南区")) //剖面构型(江南区）
                                    {
                                        if (fdysfzDt.Rows[i]["PMGX_JN"].ToString().Trim().Equals(indexValueArray[5]))
                                        {
                                            shuidaofenzhiArray[5] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    if (gjyjq.Equals("华南区"))//剖面构型（华南区）
                                    {
                                        if (fdysfzDt.Rows[i]["PMGX_HN"].ToString().Trim().Equals(indexValueArray[5]))
                                        {
                                            shuidaofenzhiArray[5] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //有机质含量
                                    if (!fdysfzDt.Rows[i]["YJZHL_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["YJZHL_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[6].Trim()) && double.Parse(fdysfzDt.Rows[i]["YJZHL_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[6].Trim()))
                                        {
                                            shuidaofenzhiArray[6] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //PH值
                                    if (!fdysfzDt.Rows[i]["PHZ_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["PHZ_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[7].Trim()) && double.Parse(fdysfzDt.Rows[i]["PHZ_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[7].Trim()))
                                        {
                                            shuidaofenzhiArray[7] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //灌溉保证率
                                    if (fdysfzDt.Rows[i]["GGBZL"].ToString().Trim().Equals(indexValueArray[8]))
                                    {
                                        shuidaofenzhiArray[8] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                    //排水条件
                                    if (fdysfzDt.Rows[i]["PSTJ"].ToString().Trim().Equals(indexValueArray[9]))
                                    {
                                        shuidaofenzhiArray[9] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                }
                                #endregion
                            }
                            #region 指定作物5分等因素分值（中稻）
                            bool breakflag = false;
                            int[] ZD5fenzhiChkArray = new int[10];
                            string[] ZD5fenzhiChkNameArray;
                            bool bZD5fengzhiCHk = false;
                            for (int k = 0; k < feature.Fields.FieldCount; k++)
                            {
                                if (feature.Fields.Field[k].Name.Equals("ZD5YXTCHDFZ"))
                                {
                                    bZD5fengzhiCHk = true;
                                }
                            }
                            if (bZD5fengzhiCHk)
                            {
                                ZD5fenzhiChkNameArray = new string[] { "ZD5DXFZ", "ZD5TMPDFZ", "ZD5DXSWFZ", "ZD5YXTCHDFZ", "ZD5BTZDFZ", "ZD5PMGXFZ", "ZD5YJZHLFZ", "ZD5PHFZ", "ZD5GGBZLFZ", "ZD5PSTJFZ" };
                            }
                            else
                            {
                                ZD5fenzhiChkNameArray = new string[] { "ZD5DXFZ", "ZD5TMPDFZ", "ZD5DXSWFZ", "ZD5YXTCHDF", "ZD5BTZDFZ", "ZD5PMGXFZ", "ZD5YJZHLFZ", "ZD5PHFZ", "ZD5GGBZLFZ", "ZD5PSTJFZ" };
                            }
                            for (int i = 0; i < ZD5fenzhiChkNameArray.Length; i++)
                            {
                                if (!int.TryParse(feature.get_Value(feature.Fields.FindField(ZD5fenzhiChkNameArray[i])).ToString(), out formatInt))
                                {
                                    DataRow newRow = indexScoreChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = ZD5fenzhiChkNameArray[i];
                                    newRow[4] = "值格式不正确";
                                    breakflag = true;
                                    indexScoreChkResultDt.Rows.Add(newRow);
                                    continue;
                                }
                                ZD5fenzhiChkArray[i] = int.Parse(feature.get_Value(feature.Fields.FindField(ZD5fenzhiChkNameArray[i])).ToString());
                            }
                            if (breakflag)
                            {
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            #endregion
                            #region 检查
                            for (int i = 0; i < 10; i++)
                            {
                                if (ZD5fenzhiChkArray[i] != shuidaofenzhiArray[i])//指定作物5
                                {
                                    DataRow newRow = indexScoreChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = ZD5fenzhiChkNameArray[i];
                                    newRow[4] = "选择不正确";
                                    indexScoreChkResultDt.Rows.Add(newRow);
                                }
                            }
                            #endregion
                        }
                        else
                        {
                            int[] ganshufenzhiArray = new int[10];
                            int[] huashengfenzhiArray = new int[10];
                            for (int i = 0; i < fdysfzDt.Rows.Count; i++)
                            {
                                #region 确定甘薯分等因素的分值标准
                                if (fdysfzDt.Rows[i]["ZuoWu"].ToString().Trim().Equals("甘薯"))
                                {
                                    //地形
                                    if (!fdysfzDt.Rows[i]["DX_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["DX_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[0].Trim()) && double.Parse(fdysfzDt.Rows[i]["DX_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[0].Trim()))
                                        {
                                            ganshufenzhiArray[0] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //田面坡度
                                    if (!fdysfzDt.Rows[i]["TMPD_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["TMPD_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[1].Trim()) && double.Parse(fdysfzDt.Rows[i]["TMPD_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[1].Trim()))
                                        {
                                            ganshufenzhiArray[1] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //地下水位
                                    if (!fdysfzDt.Rows[i]["DXSW_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["DXSW_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[2].Trim()) && double.Parse(fdysfzDt.Rows[i]["DXSW_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[2].Trim()))
                                        {
                                            ganshufenzhiArray[2] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //有效土层厚度
                                    if (!fdysfzDt.Rows[i]["YXTCHD_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["YXTCHD_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[3].Trim()) && double.Parse(fdysfzDt.Rows[i]["YXTCHD_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[3]))
                                        {
                                            ganshufenzhiArray[3] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //表土质地
                                    if (fdysfzDt.Rows[i]["BTZD"].ToString().Trim().Equals(indexValueArray[4]))
                                    {
                                        ganshufenzhiArray[4] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                    if (gjyjq.Equals("江南区")) //剖面构型(江南区）
                                    {
                                        if (fdysfzDt.Rows[i]["PMGX_JN"].ToString().Trim().Equals(indexValueArray[5]))
                                        {
                                            ganshufenzhiArray[5] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    if (gjyjq.Equals("华南区"))//剖面构型（华南区）
                                    {
                                        if (fdysfzDt.Rows[i]["PMGX_HN"].ToString().Trim().Equals(indexValueArray[5]))
                                        {
                                            ganshufenzhiArray[5] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //有机质含量
                                    if (!fdysfzDt.Rows[i]["YJZHL_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["YJZHL_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[6].Trim()) && double.Parse(fdysfzDt.Rows[i]["YJZHL_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[6].Trim()))
                                        {
                                            ganshufenzhiArray[6] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //PH值
                                    if (!fdysfzDt.Rows[i]["PHZ_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["PHZ_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[7].Trim()) && double.Parse(fdysfzDt.Rows[i]["PHZ_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[7].Trim()))
                                        {
                                            ganshufenzhiArray[7] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //灌溉保证率
                                    if (fdysfzDt.Rows[i]["GGBZL"].ToString().Trim().Equals(indexValueArray[8]))
                                    {
                                        ganshufenzhiArray[8] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                    //排水条件
                                    if (fdysfzDt.Rows[i]["PSTJ"].ToString().Trim().Equals(indexValueArray[9]))
                                    {
                                        ganshufenzhiArray[9] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }

                                }
                                #endregion
                                #region 确定花生分等因素的分值标准
                                if (fdysfzDt.Rows[i]["ZuoWu"].ToString().Trim().Equals("花生"))
                                {

                                    //地形
                                    if (!fdysfzDt.Rows[i]["DX_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["DX_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[0].Trim()) && double.Parse(fdysfzDt.Rows[i]["DX_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[0].Trim()))
                                        {
                                            huashengfenzhiArray[0] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //田面坡度
                                    if (!fdysfzDt.Rows[i]["TMPD_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["TMPD_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[1].Trim()) && double.Parse(fdysfzDt.Rows[i]["TMPD_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[1].Trim()))
                                        {
                                            huashengfenzhiArray[1] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //地下水位
                                    if (!fdysfzDt.Rows[i]["DXSW_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["DXSW_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[2].Trim()) && double.Parse(fdysfzDt.Rows[i]["DXSW_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[2].Trim()))
                                        {
                                            huashengfenzhiArray[2] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //有效土层厚度
                                    if (!fdysfzDt.Rows[i]["YXTCHD_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["YXTCHD_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[3].Trim()) && double.Parse(fdysfzDt.Rows[i]["YXTCHD_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[3]))
                                        {
                                            huashengfenzhiArray[3] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //表土质地
                                    if (fdysfzDt.Rows[i]["BTZD"].ToString().Trim().Equals(indexValueArray[4]))
                                    {
                                        huashengfenzhiArray[4] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                    if (gjyjq.Equals("江南区")) //剖面构型(江南区）
                                    {
                                        if (fdysfzDt.Rows[i]["PMGX_JN"].ToString().Trim().Equals(indexValueArray[5]))
                                        {
                                            huashengfenzhiArray[5] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    if (gjyjq.Equals("华南区"))//剖面构型（华南区）
                                    {
                                        if (fdysfzDt.Rows[i]["PMGX_HN"].ToString().Trim().Equals(indexValueArray[5]))
                                        {
                                            huashengfenzhiArray[5] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //有机质含量
                                    if (!fdysfzDt.Rows[i]["YJZHL_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["YJZHL_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[6].Trim()) && double.Parse(fdysfzDt.Rows[i]["YJZHL_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[6].Trim()))
                                        {
                                            huashengfenzhiArray[6] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //PH值
                                    if (!fdysfzDt.Rows[i]["PHZ_minValue"].ToString().Trim().Equals(""))
                                    {
                                        if (double.Parse(fdysfzDt.Rows[i]["PHZ_minValue"].ToString().Trim()) <= double.Parse(indexValueArray[7].Trim()) && double.Parse(fdysfzDt.Rows[i]["PHZ_maxValue"].ToString().Trim()) > double.Parse(indexValueArray[7].Trim()))
                                        {
                                            huashengfenzhiArray[7] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                        }
                                    }
                                    //灌溉保证率
                                    if (fdysfzDt.Rows[i]["GGBZL"].ToString().Trim().Equals(indexValueArray[8]))
                                    {
                                        huashengfenzhiArray[8] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }
                                    //排水条件
                                    if (fdysfzDt.Rows[i]["PSTJ"].ToString().Trim().Equals(indexValueArray[9]))
                                    {
                                        huashengfenzhiArray[9] = int.Parse(fdysfzDt.Rows[i]["FZ"].ToString());
                                    }

                                }
                                #endregion
                            }
                            #region 指定作物3分等因素分值(春花生)
                            bool breakflag = false;
                            int[] ZD3fenzhiChkArray = new int[10];
                            string[] ZD3fenzhiChkNameArray;
                            bool yxtc3OK = false;
                            for (int k = 0; k < feature.Fields.FieldCount; k++)
                            {
                                if (feature.Fields.Field[k].Name.Equals("ZD3YXTCHDFZ"))
                                {
                                    yxtc3OK = true;
                                }
                            }
                            if (yxtc3OK)
                            {
                                ZD3fenzhiChkNameArray = new string[] { "ZD3DXFZ", "ZD3TMPDFZ", "ZD3DXSWFZ", "ZD3YXTCHDFZ", "ZD3BTZDFZ", "ZD3PMGXFZ", "ZD3YJZHLFZ", "ZD3PHFZ", "ZD3GGBZLFZ", "ZD3PSTJFZ" };
                            }
                            else
                            {
                                ZD3fenzhiChkNameArray = new string[] { "ZD3DXFZ", "ZD3TMPDFZ", "ZD3DXSWFZ", "ZD3YXTCHDF", "ZD3BTZDFZ", "ZD3PMGXFZ", "ZD3YJZHLFZ", "ZD3PHFZ", "ZD3GGBZLFZ", "ZD3PSTJFZ" };
                            }
                            for (int i = 0; i < ZD3fenzhiChkArray.Length; i++)
                            {
                                if (!int.TryParse(feature.get_Value(feature.Fields.FindField(ZD3fenzhiChkNameArray[i])).ToString(), out formatInt))
                                {
                                    DataRow newRow = indexScoreChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = ZD3fenzhiChkNameArray[i];
                                    newRow[4] = "值格式不正确";
                                    breakflag = true;
                                    indexScoreChkResultDt.Rows.Add(newRow);
                                    continue;
                                }
                                ZD3fenzhiChkArray[i] = int.Parse(feature.get_Value(feature.Fields.FindField(ZD3fenzhiChkNameArray[i])).ToString());
                            }
                            if (breakflag)
                            {
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            #endregion
                            #region 指定作物4分等因素分值(秋甘薯）
                            int[] ZD4fenzhiChkArray = new int[10];
                            string[] ZD4fenzhiChkNameArray;
                            bool yxtc4OK = false;
                            for (int k = 0; k < feature.Fields.FieldCount; k++)
                            {
                                if (feature.Fields.Field[k].Name.Equals("ZD4YXTCHDFZ"))
                                {
                                    yxtc4OK = true;
                                }
                            }
                            if (yxtc4OK)
                            {
                                ZD4fenzhiChkNameArray = new string[] { "ZD4DXFZ", "ZD4TMPDFZ", "ZD4DXSWFZ", "ZD4YXTCHDFZ", "ZD4BTZDFZ", "ZD4PMGXFZ", "ZD4YJZHLFZ", "ZD4PHFZ", "ZD4GGBZLFZ", "ZD4PSTJFZ" };
                            }
                            else
                            {
                                ZD4fenzhiChkNameArray = new string[] { "ZD4DXFZ", "ZD4TMPDFZ", "ZD4DXSWFZ", "ZD4YXTCHDF", "ZD4BTZDFZ", "ZD4PMGXFZ", "ZD4YJZHLFZ", "ZD4PHFZ", "ZD4GGBZLFZ", "ZD4PSTJFZ" };
                            }
                            for (int i = 0; i < ZD4fenzhiChkArray.Length; i++)
                            {
                                if (!int.TryParse(feature.get_Value(feature.Fields.FindField(ZD4fenzhiChkNameArray[i])).ToString(), out formatInt))
                                {
                                    DataRow newRow = indexScoreChkResultDt.NewRow();
                                    newRow[0] = xmc;
                                    newRow[1] = xz;
                                    newRow[2] = sjdybh;
                                    newRow[3] = ZD4fenzhiChkNameArray[i];
                                    newRow[4] = "值格式不正确";
                                    breakflag = true;
                                    indexScoreChkResultDt.Rows.Add(newRow);
                                    continue;
                                }
                                ZD4fenzhiChkArray[i] = int.Parse(feature.get_Value(feature.Fields.FindField(ZD4fenzhiChkNameArray[i])).ToString());
                            }
                            if (breakflag)
                            {
                                feature = featureCursor.NextFeature();
                                continue;
                            }
                            #endregion
                            #region 检查
                            for (int i = 0; i < 10; i++)
                            {
                                if (gzzd.Contains("花生") && gzzd.Contains("甘薯"))
                                {
                                    if (ZD3fenzhiChkArray[i] != huashengfenzhiArray[i])//指定作物3
                                    {
                                        DataRow newRow = indexScoreChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = ZD3fenzhiChkNameArray[i];
                                        newRow[4] = "选择不正确";
                                        indexScoreChkResultDt.Rows.Add(newRow);
                                    }
                                    if (ZD4fenzhiChkArray[i] != ganshufenzhiArray[i])//指定作物4
                                    {
                                        DataRow newRow = indexScoreChkResultDt.NewRow();
                                        newRow[0] = xmc;
                                        newRow[1] = xz;
                                        newRow[2] = sjdybh;
                                        newRow[3] = ZD4fenzhiChkNameArray[i];
                                        newRow[4] = "选择不正确";
                                        indexScoreChkResultDt.Rows.Add(newRow);
                                    }
                                }
                            }
                            #endregion
                        }
                    }
                    #endregion
                    feature = featureCursor.NextFeature();
                }
                return indexScoreChkResultDt;
            }
            catch (Exception ex)
            {
                if (ex.Message.ToString().Contains("not within the valid range"))
                {
                    MessageBox.Show("因素分值检查过程中出现错误：出现非法字段（与成果要求不一致）");
                }
                else MessageBox.Show("因素分值检查过程中出现错误：" + exceptionInfo + ex.Message);
                return indexScoreChkResultDt;
            }
        }

        /// <summary>年度变更专题数据库与综合数据库记录属性值一致性检查
        /// </summary>
        /// <param name="ztFeatureClass"></param>
        /// <param name="zhFeatureClass"></param>
        /// <returns></returns>
        public DataTable GetZTAndZHRecordConsistenceCheckDt(IFeatureClass ztFeatureClass, IFeatureClass zhFeatureClass)
        {
            if (ztFeatureClass == null || zhFeatureClass == null) return null;
            //初始化表格列标题
            DataTable ZTAndZHRecordConsistenceCheckDt = new DataTable();
            DataColumn column = new DataColumn("图层名");
            ZTAndZHRecordConsistenceCheckDt.Columns.Add(column);
            column = new DataColumn("县级分等单元编号");
            ZTAndZHRecordConsistenceCheckDt.Columns.Add(column);
            column = new DataColumn("对应综合数据库图层县级分等单元编号");
            ZTAndZHRecordConsistenceCheckDt.Columns.Add(column);
            column = new DataColumn("检查结果");
            ZTAndZHRecordConsistenceCheckDt.Columns.Add(column);
            try
            {
                List<string> zhfieldsNameList = m_readDataCheckConfig.GetAttributeValueListFromNodeName("DataBaseTable", "name", "县级耕地质量等级年度变更综合数据库", "Field", "name");
                List<string> ztfieldsNameList = m_readDataCheckConfig.GetAttributeValueListFromNodeName("DataBaseTable", "name", "县级耕地质量等级年度变更专题数据库", "Field", "name");
                if (zhfieldsNameList.Count == 0 || ztfieldsNameList.Count == 0)
                {
                    DataRow newRow = ZTAndZHRecordConsistenceCheckDt.NewRow();
                    newRow[0] = "";
                    newRow[1] = "";
                    newRow[2] = "";
                    newRow[3] = "未检查。软件异常：读取字段配置文件错误！";
                    ZTAndZHRecordConsistenceCheckDt.Rows.Add(newRow);
                    return ZTAndZHRecordConsistenceCheckDt;
                }
                zhfieldsNameList.Remove("PCMJ");
                ztfieldsNameList.Remove("PCMJ");
                //分两种情况进行检查
                //1、专题数据库NDBGQK(年度变更情况)为“新增”，则原属性值为“空”，新属性值“不为空”，且与综合数据图层一致。
                IQueryFilter pQueryFilter = new QueryFilterClass();
                pQueryFilter.WhereClause = "NDBGQK <> '减少' AND NDBGQK <> 'J' AND NDBGQK <> '净面积变化' AND NDBGQK <> 'M'";
                IFeatureCursor ztFeatureCursor = ztFeatureClass.Search(pQueryFilter, false);
                IFeature ztFeature = ztFeatureCursor.NextFeature();
                while (ztFeature != null)
                {
                    string ztNDBGQK = ztFeature.get_Value(ztFeature.Fields.FindField("NDBGQK")).ToString().Trim();
                    string ztBGYY = ztFeature.get_Value(ztFeature.Fields.FindField("BGYY")).ToString().Trim();
                    string ztFXJDYBH = ztFeature.get_Value(ztFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    IQueryFilter zhQueryFilter = new QueryFilterClass();
                    zhQueryFilter.WhereClause = "XJDYBH = '" + ztFXJDYBH + "'";
                    IFeatureCursor zhFeatureCursor = zhFeatureClass.Search(zhQueryFilter, false);
                    IFeature zhFeature = zhFeatureCursor.NextFeature();
                    if (zhFeature == null)
                    {
                        DataRow newRow = ZTAndZHRecordConsistenceCheckDt.NewRow();
                        newRow[0] = "年度变更专题数据库图层";
                        newRow[1] = ztFXJDYBH;
                        newRow[2] = "无";
                        newRow[3] = "未找到综合数据库中对应单元编号";
                        ZTAndZHRecordConsistenceCheckDt.Rows.Add(newRow);
                    }
                    else
                    {
                        string zhFXJDYBH = zhFeature.get_Value(zhFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                        //核对综合数据库与专题数据库的一致性
                        //读取配置文件的字段
                        string zhValue = "";
                        string ztValue = "";
                        if (ztNDBGQK.Contains("新增") || ztNDBGQK.Contains("X"))
                        {
                            for (int i = 0; i < zhFeature.Fields.FieldCount; i++)
                            {
                                for (int j = 0; j < ztFeature.Fields.FieldCount; j++)
                                {
                                    if (!(zhFeature.Fields.Field[i].Name.Contains("ID") || zhFeature.Fields.Field[i].Name.Contains("Shape") || zhFeature.Fields.Field[i].Name.Contains("SHAPE") || zhFeature.Fields.Field[i].Name.Contains("MJ") || zhFeature.Fields.Field[i].Name.Contains("XJDYBH")) && (zhFeature.Fields.Field[i].Name.Equals(ztFeature.Fields.Field[j].Name) || ("X" + zhFeature.Fields.Field[i].Name).Equals(ztFeature.Fields.Field[j].Name)))
                                    {
                                        zhValue = zhFeature.get_Value(zhFeature.Fields.FindField(zhFeature.Fields.Field[i].Name)).ToString().Trim();
                                        ztValue = ztFeature.get_Value(ztFeature.Fields.FindField(ztFeature.Fields.Field[j].Name)).ToString().Trim();
                                        if (!zhValue.Equals(ztValue))
                                        {
                                            DataRow newRow = ZTAndZHRecordConsistenceCheckDt.NewRow();
                                            newRow[0] = "年度变更专题数据库图层";
                                            newRow[1] = ztFXJDYBH;
                                            newRow[2] = zhFXJDYBH;
                                            newRow[3] = "专题图层字段[" + ztFeature.Fields.Field[j].Name + "]的值与对应综合图层字段[" + zhFeature.Fields.Field[i].Name + "]的值不一致";
                                            ZTAndZHRecordConsistenceCheckDt.Rows.Add(newRow);
                                        }
                                    }
                                }
                            }
                            #region
                            //for (int i = 0; i < ztFeature.Fields .FieldCount; i++)
                            //{
                            //    for (int j = 0; j < zhFeature.Fields.FieldCount; j++)
                            //    {
                            //        if ((ztfieldsNameList[j].Length == zhfieldsNameList[i].Length) && ztfieldsNameList[j].EndsWith(zhfieldsNameList[i]))
                            //        {
                            //            string zhFieldValue = zhFeature.get_Value(zhFeature.Fields.FindField(zhfieldsNameList[i])).ToString().Trim();
                            //            string ztFieldValue = ztFeature.get_Value(ztFeature.Fields.FindField(ztfieldsNameList[j])).ToString().Trim();
                            //            if (!zhFieldValue.Equals(ztFieldValue))
                            //            {
                            //                DataRow newRow = ZTAndZHRecordConsistenceCheckDt.NewRow();
                            //                newRow[0] = "年度变更专题数据库图层";
                            //                newRow[1] = ztFXJDYBH;
                            //                newRow[2] = zhFXJDYBH;
                            //                newRow[3] = "字段[" + ztfieldsNameList[j] + "]的值与字段[" + ztfieldsNameList[j] + "]的值不一致";
                            //                ZTAndZHRecordConsistenceCheckDt.Rows.Add(newRow);
                            //            }
                            //        }
                            //        else if ((ztfieldsNameList[j].Length == zhfieldsNameList[i].Length + 1) && !ztfieldsNameList[j].StartsWith("Y") && ztfieldsNameList[j].EndsWith(zhfieldsNameList[i]))
                            //        {
                            //            string zhFieldValue = zhFeature.get_Value(zhFeature.Fields.FindField(zhfieldsNameList[i])).ToString().Trim();
                            //            string ztFieldValue = ztFeature.get_Value(ztFeature.Fields.FindField(ztfieldsNameList[j])).ToString().Trim();
                            //            if (!zhFieldValue.Equals(ztFieldValue))
                            //            {
                            //                DataRow newRow = ZTAndZHRecordConsistenceCheckDt.NewRow();
                            //                newRow[0] = "年度变更专题数据库图层";
                            //                newRow[1] = ztFXJDYBH;
                            //                newRow[2] = ztFXJDYBH;
                            //                newRow[3] = "字段[" + ztfieldsNameList[j] + "]的值与字段[" + ztfieldsNameList[j] + "]的值不一致";
                            //                ZTAndZHRecordConsistenceCheckDt.Rows.Add(newRow);
                            //            }
                            //        }
                            //    }
                            //}
                            #endregion
                        }
                        else if (ztNDBGQK.Contains("质量") || ztNDBGQK.Contains("G") || ztNDBGQK.Contains("D"))
                        {
                            for (int i = 0; i < zhFeature.Fields.FieldCount; i++)
                            {
                                for (int j = 0; j < ztFeature.Fields.FieldCount; j++)
                                {
                                    if (!(zhFeature.Fields.Field[i].Name.Contains("ID") || zhFeature.Fields.Field[i].Name.Contains("Shape") || zhFeature.Fields.Field[i].Name.Contains("SHAPE") || zhFeature.Fields.Field[i].Name.Contains("MJ") || zhFeature.Fields.Field[i].Name.Contains("XJDYBH")) && (zhFeature.Fields.Field[i].Name.Equals(ztFeature.Fields.Field[j].Name) || ("X" + zhFeature.Fields.Field[i].Name).Equals(ztFeature.Fields.Field[j].Name)))
                                    {
                                        zhValue = zhFeature.get_Value(zhFeature.Fields.FindField(zhFeature.Fields.Field[i].Name)).ToString().Trim();
                                        ztValue = ztFeature.get_Value(ztFeature.Fields.FindField(ztFeature.Fields.Field[j].Name)).ToString().Trim();
                                        if (!zhValue.Equals(ztValue))
                                        {
                                            DataRow newRow = ZTAndZHRecordConsistenceCheckDt.NewRow();
                                            newRow[0] = "年度变更专题数据库图层";
                                            newRow[1] = ztFXJDYBH;
                                            newRow[2] = zhFXJDYBH;
                                            newRow[3] = "专题图层字段[" + ztFeature.Fields.Field[j].Name + "]的值与对应综合图层字段[" + zhFeature.Fields.Field[i].Name + "]的值不一致";
                                            ZTAndZHRecordConsistenceCheckDt.Rows.Add(newRow);
                                        }
                                    }
                                }
                            }
                        }
                        else if ((ztNDBGQK.Contains("减少") || ztNDBGQK.Contains("J"))&&ztBGYY.Contains("农业结构调整"))
                        {
                            for (int i = 0; i < zhFeature.Fields.FieldCount; i++)
                            {
                                for (int j = 0; j < ztFeature.Fields.FieldCount; j++)
                                {
                                    if (!(zhFeature.Fields.Field[i].Name.Contains("ID") || zhFeature.Fields.Field[i].Name.Contains("Shape") || zhFeature.Fields.Field[i].Name.Contains("SHAPE") || zhFeature.Fields.Field[i].Name.Contains("MJ") || zhFeature.Fields.Field[i].Name.Contains("XJDYBH")) && (zhFeature.Fields.Field[i].Name.Equals(ztFeature.Fields.Field[j].Name) || ("X" + zhFeature.Fields.Field[i].Name).Equals(ztFeature.Fields.Field[j].Name)))
                                    {
                                        zhValue = zhFeature.get_Value(zhFeature.Fields.FindField(zhFeature.Fields.Field[i].Name)).ToString().Trim();
                                        ztValue = ztFeature.get_Value(ztFeature.Fields.FindField(ztFeature.Fields.Field[j].Name)).ToString().Trim();
                                        if (!zhValue.Equals(ztValue))
                                        {
                                            DataRow newRow = ZTAndZHRecordConsistenceCheckDt.NewRow();
                                            newRow[0] = "年度变更专题数据库图层";
                                            newRow[1] = ztFXJDYBH;
                                            newRow[2] = zhFXJDYBH;
                                            newRow[3] = "专题图层字段[" + ztFeature.Fields.Field[j].Name + "]的值与对应综合图层字段[" + zhFeature.Fields.Field[i].Name + "]的值不一致";
                                            ZTAndZHRecordConsistenceCheckDt.Rows.Add(newRow);
                                        }
                                    }
                                }
                            }
                        }
                        else//这里需要连接2010的数据。或者重新计算下？
                        {

                        }
                    }
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(zhFeatureCursor);
                    ztFeature = ztFeatureCursor.NextFeature();
                }
                System.Runtime.InteropServices.Marshal.ReleaseComObject(ztFeatureCursor);
                //2、年度变更专题数据库中NDBGQK(年度变更情况）为“减少”的情况
                /*
                ztQueryFilter = new QueryFilterClass();
                ztQueryFilter.WhereClause = "NDBGQK = '减少'";
                ztFeatureCursor = ztFeatureClass.Search(ztQueryFilter, false);
                ztFeature = ztFeatureCursor.NextFeature();
                while (ztFeature != null)
                {
                    string ztFYXJDYBH = ztFeature.get_Value(ztFeature.Fields.FindField("YXJDYBH")).ToString().Trim();
                    string ztFXJDYBH = ztFeature.get_Value(ztFeature.Fields.FindField("XJDYBH")).ToString().Trim();
                    if (!ztFYXJDYBH.Equals(ztFXJDYBH))
                    {
                        DataRow newRow = ZTAndZHRecordConsistenceCheckDt.NewRow();
                        newRow[0] = "年度变更专题数据库图层";
                        newRow[1] = ztFXJDYBH;
                        newRow[2] = ztFYXJDYBH;
                        newRow[3] = "字段[YXJDYBH]的值与字段[XJDYBH]的值不一致";
                        ZTAndZHRecordConsistenceCheckDt.Rows.Add(newRow);
                    }
                    else
                    {
                        for (int i = 0; i < ztfieldsNameList.Count; i++)
                        {
                            if (ztfieldsNameList[i].StartsWith("Y") && !ztfieldsNameList[i].Contains("YJQMC"))
                            {
                                string xFiledName = "X" + ztfieldsNameList[i].Substring(1, (ztfieldsNameList[i].Trim().Length - 1));
                                if (ztFeature.Fields.FindField(xFiledName).Equals(-1)) continue;
                                string yFieldValue = ztFeature.get_Value(ztFeature.Fields.FindField(ztfieldsNameList[i])).ToString().Trim();
                                string xFieldValue = ztFeature.get_Value(ztFeature.Fields.FindField(xFiledName)).ToString().Trim();
                                if (!yFieldValue.Equals(xFieldValue))
                                {
                                    DataRow newRow = ZTAndZHRecordConsistenceCheckDt.NewRow();
                                    newRow[0] = "年度变更专题数据库图层";
                                    newRow[1] = ztFXJDYBH;
                                    newRow[2] = ztFYXJDYBH;
                                    newRow[3] = "字段[" + xFiledName + "]的值与字段[" + ztfieldsNameList[i] + "]的值不一致";
                                    ZTAndZHRecordConsistenceCheckDt.Rows.Add(newRow);

                                }
                            }
                        }
                    }
                    ztFeature = ztFeatureCursor.NextFeature();
                }
                */
                return ZTAndZHRecordConsistenceCheckDt;
            }
            catch (System.Exception ex)
            {
                if (ex.Message.Contains("参数不足"))
                {
                    DataRow newRow = ZTAndZHRecordConsistenceCheckDt.NewRow();
                    newRow[0] = "";
                    newRow[1] = "";
                    newRow[2] = "";
                    newRow[3] = "检查发生异常：图层中无“NDBGQK(年度变更情况)字段";
                    ZTAndZHRecordConsistenceCheckDt.Rows.Add(newRow);
                    return ZTAndZHRecordConsistenceCheckDt;
                }
                else
                {
                    DataRow newRow = ZTAndZHRecordConsistenceCheckDt.NewRow();
                    newRow[0] = "";
                    newRow[1] = "";
                    newRow[2] = "";
                    newRow[3] = "检查发生异常:" + ex.Message;
                    ZTAndZHRecordConsistenceCheckDt.Rows.Add(newRow);
                    return ZTAndZHRecordConsistenceCheckDt;
                }
            }
        }

        /// <summary>年度变更专题数据库与综合数据库面积一致性检查
        /// </summary>
        /// <param name="ztFeatureClass"></param>
        /// <param name="zhFeatureClass"></param>
        /// <returns></returns>
        public DataTable GetZTAndZHAreaConsistenceCheckDt(IFeatureClass ztFeatureClass, IFeatureClass zhFeatureClass)
        {
            if (ztFeatureClass == null || zhFeatureClass == null) return null;
            //初始化表格列标题
            DataTable ZTAndZHAreaConsistenceCheckDt = new DataTable();
            DataColumn column = new DataColumn("地类名称");//0
            ZTAndZHAreaConsistenceCheckDt.Columns.Add(column);
            column = new DataColumn("地类代码");//1
            ZTAndZHAreaConsistenceCheckDt.Columns.Add(column);
            column = new DataColumn("新增耕地面积");//2
            ZTAndZHAreaConsistenceCheckDt.Columns.Add(column);
            column = new DataColumn("减少耕地面积");//3
            ZTAndZHAreaConsistenceCheckDt.Columns.Add(column);
            column = new DataColumn("净增加耕地面积");//4
            ZTAndZHAreaConsistenceCheckDt.Columns.Add(column);
            column = new DataColumn("净减少耕地面积");//5
            ZTAndZHAreaConsistenceCheckDt.Columns.Add(column);
            column = new DataColumn("2010年耕地面积");//6
            ZTAndZHAreaConsistenceCheckDt.Columns.Add(column);
            column = new DataColumn("2011年耕地面积");//7
            ZTAndZHAreaConsistenceCheckDt.Columns.Add(column);
            column = new DataColumn("检查结果");//8
            ZTAndZHAreaConsistenceCheckDt.Columns.Add(column);
            try
            {
                IFeatureLayer ztFeatureLayer = new FeatureLayerClass();
                ztFeatureLayer.FeatureClass = ztFeatureClass;
                IFeatureCursor pFeatureCursor = ztFeatureClass.Search(null, false);
                IFeature pFeature = pFeatureCursor.NextFeature();
                if (pFeature == null)
                {
                    DataRow newRow = ZTAndZHAreaConsistenceCheckDt.NewRow();
                    for (int i = 0; i < 8; i++)
                    {
                        newRow[i] = "";
                    }
                    newRow[8] = "无变更耕地数据";
                    ZTAndZHAreaConsistenceCheckDt.Rows.Add(newRow);
                    return ZTAndZHAreaConsistenceCheckDt;
                }
                string cityName = pFeature.get_Value(pFeature.Fields.FindField("S")).ToString().Trim();
                string quxianName = pFeature.get_Value(pFeature.Fields.FindField("X")).ToString().Trim();
                ArrayList arr = new ArrayList();
                arr = GetLayerFieldValueByDataStatistics(ztFeatureLayer, "DLDM");//获取综合数据库图层的地类值
                Dictionary<object, double> dic = new Dictionary<object, double>();
                foreach (object o in arr)
                {
                    if (!dic.ContainsKey(o))
                        dic.Add(o, 1);
                    else
                        dic[o]++;
                }
                 double newAddArea =0.0;
                 double decArea = 0.0;
                 double onlyAddArea = 0.0;
                 double onlyDecArea = 0.0;
                foreach (object o in dic.Keys)
                {
                    newAddArea = StatisticsMJ(ztFeatureLayer, "PCMJ", "DLDM = '" + Convert.ToString(o) + "' AND (NDBGQK = '新增' OR NDBGQK = 'X')");
                    decArea = StatisticsMJ(ztFeatureLayer, "PCMJ", "DLDM = '" + Convert.ToString(o) + "' AND (NDBGQK = '减少' OR NDBGQK = 'J')");
                    onlyAddArea = StatisticsMJ(ztFeatureLayer, "PCMJ", "DLDM = '" + Convert.ToString(o) + "' AND (NDBGQK = '净面积增加' OR NDBGQK = 'M')");
                    onlyDecArea = StatisticsMJ(ztFeatureLayer, "PCMJ", "DLDM = '" + Convert.ToString(o) + "' AND (NDBGQK = '净面积减少' OR NDBGQK = 'M')");
                    if (Convert.ToString(o) == "011")
                    {

                        DataRow newRow = ZTAndZHAreaConsistenceCheckDt.NewRow();
                        newRow[0] = "水田";
                        newRow[1] = "011";
                        newRow[2] = newAddArea;
                        newRow[3] = decArea;
                        newRow[4] = onlyAddArea;
                        newRow[5] = onlyDecArea;
                        //newRow[6] = preSTArea;
                        //newRow[7] = curSTArea;
                        //newRow[8] = "专题地类面积与综合地类面积对应错误";
                        ZTAndZHAreaConsistenceCheckDt.Rows.Add(newRow);
                    }
                    if (Convert.ToString(o) == "012")
                    {
                        DataRow newRow = ZTAndZHAreaConsistenceCheckDt.NewRow();
                        newRow[0] = "水浇地";
                        newRow[1] = "012";
                        newRow[2] = newAddArea;
                        newRow[3] = decArea;
                        newRow[4] = onlyAddArea;
                        newRow[5] = onlyDecArea;
                        //newRow[6] = preSTArea;
                        //newRow[7] = curSTArea;
                        //newRow[8] = "专题地类面积与综合地类面积对应错误";
                        ZTAndZHAreaConsistenceCheckDt.Rows.Add(newRow);
                    }
                    if (Convert.ToString(o) == "013")
                    {
                        DataRow newRow = ZTAndZHAreaConsistenceCheckDt.NewRow();
                        newRow[0] = "旱地";
                        newRow[1] = "013";
                        newRow[2] = newAddArea;
                        newRow[3] = decArea;
                        newRow[4] = onlyAddArea;
                        newRow[5] = onlyDecArea;
                        //newRow[6] = preSTArea;
                        //newRow[7] = curSTArea;
                        //newRow[8] = "专题地类面积与综合地类面积对应错误";
                        ZTAndZHAreaConsistenceCheckDt.Rows.Add(newRow);
                    }
                }
                #region
                /*
                //获取省备案数据
                DataTable preAreaDt;
                preAreaDt = new DataTable();
                string areaSQL = "select * from zd_dileimianjihuizong_2010 where CityName = '" + cityName + "' and QuXianName = '" + quxianName + "'";
                preAreaDt = m_dicAccessDB.getDataTable(areaSQL);//获取2010年耕地面积
                if (preAreaDt.Rows.Count==0)
                {
                    DataRow newRow =ZTAndZHAreaConsistenceCheckDt.NewRow ();
                    for(int i=0;i<8;i++)
                    {
                        newRow [i]="";
                    }
                    newRow [8]="未检查：未查询到提交的省级2010年耕地面积数据";
                    ZTAndZHAreaConsistenceCheckDt .Rows .Add (newRow);
                    return ZTAndZHAreaConsistenceCheckDt;
                }
                DataTable curAreaDt;
                curAreaDt = new DataTable();
                areaSQL = "select * from zd_dileimianjihuizong_2011 where CityName = '" + cityName + "' and QuXianName = '" + quxianName + "'";
                curAreaDt = m_dicAccessDB.getDataTable(areaSQL);//获取2011年耕地面积
                if(curAreaDt.Rows.Count ==0)
                {
                    DataRow newRow =ZTAndZHAreaConsistenceCheckDt.NewRow ();
                    for(int i=0;i<8;i++)
                    {
                        newRow [i]="";
                    }
                    newRow [8]="未检查：未查询到提交的省级2011年耕地面积数据";
                    ZTAndZHAreaConsistenceCheckDt .Rows .Add (newRow);
                    return ZTAndZHAreaConsistenceCheckDt;
                }
                foreach (object o in dic.Keys)
                {
                    double newAddArea = StatisticsMJ(ztFeatureLayer, "PCMJ", "DLDM = '" + Convert.ToString(o) + "' AND NDBGQK = '新增'");
                    double decArea = StatisticsMJ(ztFeatureLayer, "PCMJ", "DLDM = '" + Convert.ToString(o) + "' AND NDBGQK = '减少'");
                    double onlyAddArea = StatisticsMJ(ztFeatureLayer, "PCMJ", "DLDM = '" + Convert.ToString(o) + "' AND NDBGQK = '净面积增加'");
                    double onlyDecArea = StatisticsMJ(ztFeatureLayer, "PCMJ", "DLDM = '" + Convert.ToString(o) + "' AND NDBGQK = '净面积减少'");
                    if (Convert.ToString(o) == "011")
                    {
                        double preSTArea=double.Parse(preAreaDt.Rows[0]["ShuiTianMianJi"].ToString());
                        double curSTArea = double.Parse(curAreaDt.Rows[0]["ShuiTianMianJi"].ToString());
                        if (Math .Abs(preSTArea+newAddArea +onlyAddArea-decArea -onlyDecArea-curSTArea)>0.1)//以阀值为0.1公顷
                        {
                            DataRow newRow = ZTAndZHAreaConsistenceCheckDt.NewRow();
                            newRow[0] = "水田";
                            newRow[1] = "011";
                            newRow[2] = newAddArea;
                            newRow[3] = decArea;
                            newRow[4] = onlyAddArea;
                            newRow[5] = onlyDecArea;
                            newRow[6] = preSTArea;
                            newRow[7] = curSTArea;
                            newRow[8] = "专题地类面积与综合地类面积对应错误";
                            ZTAndZHAreaConsistenceCheckDt.Rows.Add(newRow);
                        }
                    }
                    if (Convert.ToString(o) == "012")
                    {
                        double preSTArea = double.Parse(preAreaDt.Rows[0]["ShuiJiaoDiMianJi"].ToString());
                        double curSTArea = double.Parse(curAreaDt.Rows[0]["ShuiJiaoDiMianJi"].ToString());
                        if (Math.Abs(preSTArea + newAddArea + onlyAddArea - decArea - onlyDecArea - curSTArea) > 0.1)//以阀值为0.1公顷
                        {
                            DataRow newRow = ZTAndZHAreaConsistenceCheckDt.NewRow();
                            newRow[0] = "水浇地";
                            newRow[1] = "012";
                            newRow[2] = newAddArea;
                            newRow[3] = decArea;
                            newRow[4] = onlyAddArea;
                            newRow[5] = onlyDecArea;
                            newRow[6] = preSTArea;
                            newRow[7] = curSTArea;
                            newRow[8] = "专题地类面积与综合地类面积对应错误";
                            ZTAndZHAreaConsistenceCheckDt.Rows.Add(newRow);
                        }
                    }
                    if (Convert.ToString(o) == "013")
                    {
                        double preSTArea = double.Parse(preAreaDt.Rows[0]["HanDiMianJi"].ToString());
                        double curSTArea = double.Parse(curAreaDt.Rows[0]["HanDiMianJi"].ToString());
                        if (Math.Abs(preSTArea + newAddArea + onlyAddArea - decArea - onlyDecArea - curSTArea) > 0.1)//以阀值为0.1公顷
                        {
                            DataRow newRow = ZTAndZHAreaConsistenceCheckDt.NewRow();
                            newRow[0] = "旱地";
                            newRow[1] = "013";
                            newRow[2] = newAddArea;
                            newRow[3] = decArea;
                            newRow[4] = onlyAddArea;
                            newRow[5] = onlyDecArea;
                            newRow[6] = preSTArea;
                            newRow[7] = curSTArea;
                            newRow[8] = "专题地类面积与综合地类面积对应错误";
                            ZTAndZHAreaConsistenceCheckDt.Rows.Add(newRow);
                        }
                    }
                }
                */
                #endregion
                return ZTAndZHAreaConsistenceCheckDt;
            }
            catch (Exception ex)
            {
                DataRow newRow = ZTAndZHAreaConsistenceCheckDt.NewRow();
                for (int i = 0; i < 8; i++)
                {
                    newRow[i] = "";
                }
                if (ex.Message.Contains("参数不足"))
                {
                    newRow[8] = "检查发生异常：图层中无“NDBGQK(年度变更情况)字段";
                    ZTAndZHAreaConsistenceCheckDt.Rows.Add(newRow);
                    return ZTAndZHAreaConsistenceCheckDt;
                }
                else
                {
                    newRow[8] = "面积检查过程中，发生未知错误：" + ex.Message;
                    ZTAndZHAreaConsistenceCheckDt.Rows.Add(newRow);
                    return ZTAndZHAreaConsistenceCheckDt;
                }
            }
        }

        /// <summary>通过IDataStatistics获取图层指定字段所有值
        /// </summary>
        /// <param name="pFeatureLayer"></param>
        /// <param name="fieldName"></param>
        /// <returns>指定字段所有值</returns>
        private ArrayList GetLayerFieldValueByDataStatistics(IFeatureLayer pFeatureLayer, string fieldName)
        {
            ArrayList arrValues = new ArrayList();
            IQueryFilter pQueryFilter = new QueryFilterClass();
            IFeatureCursor pFeatureCursor = null;
            pQueryFilter.SubFields = fieldName;
            pFeatureCursor = pFeatureLayer.FeatureClass.Search(pQueryFilter, false);
            IFeature pFeature = pFeatureCursor.NextFeature();
            string str = null;
            while (pFeature != null)
            {
                str = pFeature.get_Value(pFeatureLayer.FeatureClass.FindField(fieldName)).ToString();
                arrValues.Add(str);    //arrValues
                pFeature = pFeatureCursor.NextFeature();
            }
            arrValues.Sort();
            return arrValues;
        }

        public double StatisticsMJ(IFeatureLayer pFeatureLayer, string StatisticField, string whereClause)
        {
            IQueryFilter queryFilter = new QueryFilter();
            queryFilter.WhereClause = whereClause;
            IFeatureCursor featureCursor = pFeatureLayer.FeatureClass.Search(queryFilter, false);
            IFeature feature = featureCursor.NextFeature();
            const double InvalidMinAvgPtSpc = -1;
            double sumAvgPtSpc;
            int featureCount = pFeatureLayer.FeatureClass.FeatureCount(null);

            if (featureCount == 0)
            {
                sumAvgPtSpc = InvalidMinAvgPtSpc;
            }
            else
            {
                queryFilter = new QueryFilter();
                queryFilter.WhereClause = whereClause;
                featureCursor = pFeatureLayer.FeatureClass.Search(queryFilter, false);
                ICursor cursor = featureCursor as ICursor;
                IDataStatistics dataStatistics = new DataStatisticsClass();
                dataStatistics.Field = StatisticField;
                dataStatistics.Cursor = cursor;
                IStatisticsResults statisticsResults = dataStatistics.Statistics;
                sumAvgPtSpc = Math.Round(statisticsResults.Sum / 10000, 2);
            }
            return sumAvgPtSpc;
        }
    }
}
